GCBM
|
#include <cbmaggregatorcsvwriter.h>
Public Member Functions | |
CBMAggregatorCsvWriter (std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatFluxRecord >> fluxDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatPoolRecord >> poolDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatErrorRecord >> errorDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatAgeAreaRecord >> ageDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatDisturbanceRecord >> disturbanceDimension, std::shared_ptr< std::vector< std::string >> classifierNames, bool isPrimary=false) | |
virtual | ~CBMAggregatorCsvWriter ()=default |
void | configure (const DynamicObject &config) override |
void | subscribe (NotificationCenter ¬ificationCenter) override |
flint::ModuleTypes | moduleType () override |
void | doSystemInit () override |
void | doLocalDomainInit () override |
void | doSystemShutdown () override |
Public Member Functions inherited from CBMModuleBase | |
virtual | ~CBMModuleBase ()=default |
void | onSystemInit () override |
void | onSystemShutdown () override |
void | onLocalDomainInit () override |
void | onLocalDomainShutdown () override |
void | onLocalDomainProcessingUnitInit () override |
void | onLocalDomainProcessingUnitShutdown () override |
void | onPreTimingSequence () override |
void | onTimingInit () override |
void | onTimingPrePostInit () override |
void | onTimingPostInit () override |
void | onTimingPostInit2 () override |
void | onTimingShutdown () override |
void | onTimingStep () override |
void | onTimingPreEndStep () override |
void | onTimingEndStep () override |
void | onTimingPostStep () override |
void | onOutputStep () override |
void | onPrePostDisturbanceEvent () override |
void | onPostDisturbanceEvent () override |
void | onPostDisturbanceEvent2 () override |
void | onError (std::string msg) override |
void | onDisturbanceEvent (DynamicVar e) override |
void | onPostNotification (short preMessageSignal) override |
virtual void | doLocalDomainShutdown () |
virtual void | doLocalDomainProcessingUnitInit () |
virtual void | doLocalDomainProcessingUnitShutdown () |
virtual void | doPreTimingSequence () |
virtual void | doTimingInit () |
virtual void | doTimingPrePostInit () |
virtual void | doTimingPostInit () |
virtual void | doTimingPostInit2 () |
virtual void | doTimingShutdown () |
virtual void | doTimingStep () |
virtual void | doTimingPreEndStep () |
virtual void | doTimingEndStep () |
virtual void | doTimingPostStep () |
virtual void | doOutputStep () |
virtual void | doError (std::string msg) |
virtual void | doDisturbanceEvent (DynamicVar) |
virtual void | doPrePostDisturbanceEvent () |
virtual void | doPostDisturbanceEvent () |
virtual void | doPostDisturbanceEvent2 () |
virtual void | doPostNotification (short preMessageSignal) |
Private Member Functions | |
template<typename TAccumulator > | |
void | load (const std::string &outputPath, const std::string &outputFilename, std::shared_ptr< std::vector< std::string >> classifierNames, std::shared_ptr< TAccumulator > dataDimension) |
Private Attributes | |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatFluxRecord > > | _fluxDimension |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatPoolRecord > > | _poolDimension |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatErrorRecord > > | _errorDimension |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatAgeAreaRecord > > | _ageDimension |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatDisturbanceRecord > > | _disturbanceDimension |
std::shared_ptr< std::vector< std::string > > | _classifierNames |
std::shared_ptr< const flint::SpatialLocationInfo > | _spatialLocationInfo |
std::string | _outputPath |
Int64 | _jobId |
bool | _isPrimaryAggregator |
bool | _separateYears |
CBMAggregatorCsvWriter | ( | std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatFluxRecord >> | fluxDimension, |
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatPoolRecord >> | poolDimension, | ||
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatErrorRecord >> | errorDimension, | ||
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatAgeAreaRecord >> | ageDimension, | ||
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatDisturbanceRecord >> | disturbanceDimension, | ||
std::shared_ptr< std::vector< std::string >> | classifierNames, | ||
bool | isPrimary = false |
||
) |
|
virtualdefault |
|
override |
Configuration function
Assign CBMFlatFile._outputPath value of "outptut_path" in parameter config,
CBMFlatFile._separateYears value of "separate_years", if it exists in parameter config
config | DynamicObject& |
|
overridevirtual |
Assign CBMAggregatorCsvWriter._jobId the value of variable "job_id" in _landUnitData, if it exists, else to 0
Reimplemented from CBMModuleBase.
|
overridevirtual |
If CBMAggregatorCsvWriter._isPrimaryAggregator is true, then create output directories
path | string& |
header | string& |
FileExistsException& | if file already exists |
Reimplemented from CBMModuleBase.
|
overridevirtual |
If CBMAggregatorCsvWriter._isPrimaryAggregator is true and if, CBMAggregatorCsvWriter._classifierNames is not empty, load the flux, pool, error, age and disturbance data
Reimplemented from CBMModuleBase.
|
private |
Inserting Records
Assign variable records as dataDimension->records(). If records is empty, return
If CBMAggregatorCsvWriter._separateYears is false, create output directories and write each record to the output stream
Else write the records to the output stream grouped based on the year
outputPath | string& |
outputFilename | string& |
classifierNames | shared_ptr<vector<string>> |
dataDimension | shared_ptr<TAccumulator> |
FileExistsException& | if the file already exists |
|
override |
|
override |
Subscribe to the signals SystemInit, LocalDomainInit and SystemShutdown
notificationCenter | NotificationCenter& |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |