Go to the documentation of this file. 1 #ifndef MOJA_MODULES_CBM_CBMAGGREGATORSQLITEWRITER_H_
2 #define MOJA_MODULES_CBM_CBMAGGREGATORSQLITEWRITER_H_
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
8 #include <Poco/Data/Session.h>
13 template<
class TPersistable,
class TRecord>
14 class RecordAccumulatorWithMutex2;
31 std::shared_ptr<std::vector<std::string>> classifierNames,
38 bool isPrimary =
false)
40 _dateDimension(dateDimension),
41 _poolInfoDimension(poolInfoDimension),
42 _classifierSetDimension(classifierSetDimension),
43 _landClassDimension(landClassDimension),
44 _locationDimension(locationDimension),
45 _moduleInfoDimension(moduleInfoDimension),
46 _disturbanceTypeDimension(disturbanceTypeDimension),
47 _disturbanceDimension(disturbanceDimension),
48 _classifierNames(classifierNames),
49 _poolDimension(poolDimension),
50 _fluxDimension(fluxDimension),
51 _ageClassDimension(ageClassDimension),
52 _ageAreaDimension(ageAreaDimension),
53 _errorDimension(errorDimension),
54 _locationErrorDimension(locationErrorDimension),
55 _isPrimaryAggregator(isPrimary) {}
59 void configure(
const DynamicObject& config)
override;
60 void subscribe(NotificationCenter& notificationCenter)
override;
62 flint::ModuleTypes
moduleType()
override {
return flint::ModuleTypes::System; };
64 void doSystemInit()
override;
65 void doSystemShutdown()
override;
68 std::shared_ptr<flint::RecordAccumulatorWithMutex2<DateRow, DateRecord>>
_dateDimension;
69 std::shared_ptr<flint::RecordAccumulatorWithMutex2<PoolInfoRow, PoolInfoRecord>>
_poolInfoDimension;
71 std::shared_ptr<flint::RecordAccumulatorWithMutex2<LandClassRow, LandClassRecord>>
_landClassDimension;
72 std::shared_ptr<flint::RecordAccumulatorWithMutex2<TemporalLocationRow, TemporalLocationRecord>>
_locationDimension;
74 std::shared_ptr<flint::RecordAccumulatorWithMutex2<PoolRow, PoolRecord>>
_poolDimension;
75 std::shared_ptr<flint::RecordAccumulatorWithMutex2<FluxRow, FluxRecord>>
_fluxDimension;
76 std::shared_ptr<flint::RecordAccumulatorWithMutex2<AgeClassRow, AgeClassRecord>>
_ageClassDimension;
77 std::shared_ptr<flint::RecordAccumulatorWithMutex2<AgeAreaRow, AgeAreaRecord>>
_ageAreaDimension;
80 std::shared_ptr<flint::RecordAccumulatorWithMutex2<ErrorRow, ErrorRecord>>
_errorDimension;
87 template<
typename TAccumulator>
88 void load(Poco::Data::Session& session,
89 const std::string& table,
90 std::shared_ptr<TAccumulator> dataDimension);
92 static void tryExecute(Poco::Data::Session& session,
93 std::function<
void(Poco::Data::Session&)> fn);
98 #endif // MOJA_MODULES_CBM_CBMAGGREGATORSQLITEWRITER_H_
std::shared_ptr< flint::RecordAccumulatorWithMutex2< TemporalLocationRow, TemporalLocationRecord > > _locationDimension
Definition: cbmaggregatorsqlitewriter.h:72
Definition: ageclasshelper.cpp:12
Definition: cbmaggregatorsqlitewriter.h:20
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ErrorRow, ErrorRecord > > _errorDimension
Definition: cbmaggregatorsqlitewriter.h:80
std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolRow, PoolRecord > > _poolDimension
Definition: cbmaggregatorsqlitewriter.h:74
std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolInfoRow, PoolInfoRecord > > _poolInfoDimension
Definition: cbmaggregatorsqlitewriter.h:69
Definition: cbmaggregatorcsvwriter.h:21
Definition: cbmmodulebase.h:22
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DateRow, DateRecord > > _dateDimension
Definition: cbmaggregatorsqlitewriter.h:68
std::shared_ptr< flint::RecordAccumulatorWithMutex2< LocationErrorRow, LocationErrorRecord > > _locationErrorDimension
Definition: cbmaggregatorsqlitewriter.h:81
std::string _dbName
Definition: cbmaggregatorsqlitewriter.h:84
CBMAggregatorSQLiteWriter(std::shared_ptr< flint::RecordAccumulatorWithMutex2< DateRow, DateRecord >> dateDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolInfoRow, PoolInfoRecord >> poolInfoDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ClassifierSetRow, ClassifierSetRecord >> classifierSetDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< LandClassRow, LandClassRecord >> landClassDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< TemporalLocationRow, TemporalLocationRecord >> locationDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ModuleInfoRow, ModuleInfoRecord >> moduleInfoDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceTypeRow, DisturbanceTypeRecord >> disturbanceTypeDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceRow, DisturbanceRecord >> disturbanceDimension, std::shared_ptr< std::vector< std::string >> classifierNames, std::shared_ptr< flint::RecordAccumulatorWithMutex2< PoolRow, PoolRecord >> poolDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< FluxRow, FluxRecord >> fluxDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeClassRow, AgeClassRecord >> ageClassDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeAreaRow, AgeAreaRecord >> ageAreaDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< ErrorRow, ErrorRecord >> errorDimension, std::shared_ptr< flint::RecordAccumulatorWithMutex2< LocationErrorRow, LocationErrorRecord >> locationErrorDimension, bool isPrimary=false)
Definition: cbmaggregatorsqlitewriter.h:22
std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeClassRow, AgeClassRecord > > _ageClassDimension
Definition: cbmaggregatorsqlitewriter.h:76
Definition: cbmaggregatorcsvwriter.h:19
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ClassifierSetRow, ClassifierSetRecord > > _classifierSetDimension
Definition: cbmaggregatorsqlitewriter.h:70
flint::ModuleTypes moduleType() override
Definition: cbmaggregatorsqlitewriter.h:62
std::shared_ptr< flint::RecordAccumulatorWithMutex2< ModuleInfoRow, ModuleInfoRecord > > _moduleInfoDimension
Definition: cbmaggregatorsqlitewriter.h:73
std::shared_ptr< flint::RecordAccumulatorWithMutex2< AgeAreaRow, AgeAreaRecord > > _ageAreaDimension
Definition: cbmaggregatorsqlitewriter.h:77
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceRow, DisturbanceRecord > > _disturbanceDimension
Definition: cbmaggregatorsqlitewriter.h:79
std::shared_ptr< flint::RecordAccumulatorWithMutex2< FluxRow, FluxRecord > > _fluxDimension
Definition: cbmaggregatorsqlitewriter.h:75
std::shared_ptr< std::vector< std::string > > _classifierNames
Definition: cbmaggregatorsqlitewriter.h:82
bool _isPrimaryAggregator
Definition: cbmaggregatorsqlitewriter.h:85
Definition: ageclasshelper.cpp:10
std::shared_ptr< flint::RecordAccumulatorWithMutex2< LandClassRow, LandClassRecord > > _landClassDimension
Definition: cbmaggregatorsqlitewriter.h:71
std::shared_ptr< flint::RecordAccumulatorWithMutex2< DisturbanceTypeRow, DisturbanceTypeRecord > > _disturbanceTypeDimension
Definition: cbmaggregatorsqlitewriter.h:78