Go to the documentation of this file. 1 #ifndef MOJA_MODULES_CBM_CBMAGGREGATORCSVWRITER_H_
2 #define MOJA_MODULES_CBM_CBMAGGREGATORCSVWRITER_H_
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
8 #include <moja/flint/spatiallocationinfo.h>
14 class FileOutputStream;
15 class TeeOutputStream;
20 template<
class TPersistable,
class TRecord>
29 CBMFlatFile(
const std::string& path,
const std::string& header);
33 void write(
const std::string& text);
52 std::shared_ptr<std::vector<std::string>> classifierNames,
53 bool isPrimary =
false)
55 _fluxDimension(fluxDimension),
56 _poolDimension(poolDimension),
57 _errorDimension(errorDimension),
58 _ageDimension(ageDimension),
59 _disturbanceDimension(disturbanceDimension),
60 _classifierNames(classifierNames),
61 _isPrimaryAggregator(isPrimary),
62 _separateYears(false) {}
66 void configure(
const DynamicObject& config)
override;
67 void subscribe(NotificationCenter& notificationCenter)
override;
69 flint::ModuleTypes
moduleType()
override {
return flint::ModuleTypes::System; };
71 void doSystemInit()
override;
72 void doLocalDomainInit()
override;
73 void doSystemShutdown()
override;
76 std::shared_ptr<flint::RecordAccumulatorWithMutex2<std::string, FlatFluxRecord>>
_fluxDimension;
77 std::shared_ptr<flint::RecordAccumulatorWithMutex2<std::string, FlatPoolRecord>>
_poolDimension;
78 std::shared_ptr<flint::RecordAccumulatorWithMutex2<std::string, FlatErrorRecord>>
_errorDimension;
79 std::shared_ptr<flint::RecordAccumulatorWithMutex2<std::string, FlatAgeAreaRecord>>
_ageDimension;
90 template<
typename TAccumulator>
91 void load(
const std::string& outputPath,
92 const std::string& outputFilename,
93 std::shared_ptr<std::vector<std::string>> classifierNames,
94 std::shared_ptr<TAccumulator> dataDimension);
99 #endif // MOJA_MODULES_CBM_CBMAGGREGATORCSVWRITER_H_
bool _separateYears
Definition: cbmaggregatorcsvwriter.h:88
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatAgeAreaRecord > > _ageDimension
Definition: cbmaggregatorcsvwriter.h:79
Definition: ageclasshelper.cpp:12
Definition: cbmaggregatorcsvwriter.h:21
Definition: cbmmodulebase.h:22
std::unique_ptr< Poco::FileOutputStream > _streamFile
Definition: cbmaggregatorcsvwriter.h:40
void save()
Definition: cbmaggregatorcsvwriter.cpp:69
Definition: cbmaggregatorcsvwriter.h:44
CBMFlatFile(const std::string &path, const std::string &header)
Definition: cbmaggregatorcsvwriter.cpp:44
bool _isPrimaryAggregator
Definition: cbmaggregatorcsvwriter.h:87
Definition: cbmaggregatorcsvwriter.h:12
std::shared_ptr< std::vector< std::string > > _classifierNames
Definition: cbmaggregatorcsvwriter.h:81
Definition: cbmaggregatorcsvwriter.h:19
std::unique_ptr< Poco::File > _outputFile
Definition: cbmaggregatorcsvwriter.h:39
std::unique_ptr< Poco::TeeOutputStream > _outputStream
Definition: cbmaggregatorcsvwriter.h:41
flint::ModuleTypes moduleType() override
Definition: cbmaggregatorcsvwriter.h:69
virtual ~CBMFlatFile()=default
std::string _tempPath
Definition: cbmaggregatorcsvwriter.h:38
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatFluxRecord > > _fluxDimension
Definition: cbmaggregatorcsvwriter.h:76
std::shared_ptr< const flint::SpatialLocationInfo > _spatialLocationInfo
Definition: cbmaggregatorcsvwriter.h:83
void write(const std::string &text)
Definition: cbmaggregatorcsvwriter.cpp:60
std::string _path
Definition: cbmaggregatorcsvwriter.h:37
Int64 _jobId
Definition: cbmaggregatorcsvwriter.h:86
Definition: cbmaggregatorcsvwriter.h:27
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatPoolRecord > > _poolDimension
Definition: cbmaggregatorcsvwriter.h:77
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatDisturbanceRecord > > _disturbanceDimension
Definition: cbmaggregatorcsvwriter.h:80
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)
Definition: cbmaggregatorcsvwriter.h:46
std::string _outputPath
Definition: cbmaggregatorcsvwriter.h:85
Definition: ageclasshelper.cpp:10
std::shared_ptr< flint::RecordAccumulatorWithMutex2< std::string, FlatErrorRecord > > _errorDimension
Definition: cbmaggregatorcsvwriter.h:78