DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
popdyntable.h
Go to the documentation of this file.
1 #ifndef POPDYNTABLE_H
2 #define POPDYNTABLE_H
3 
4 #include "commons_global.h"
5 #include "idtypes.h"
6 
7 #include "sqlitefielddef.h"
8 #include "sqlitetable.h"
9 using namespace sqlite;
10 
11 #include <vector>
12 #include <string>
13 #include <map>
14 
15 class Population;
16 
17 class COMMONSSHARED_EXPORT PopDynTable : public SQLiteTable
18 {
19 private:
20  struct Impl;
21  std::unique_ptr<Impl> p;
22 public:
23  const FieldDef<FieldType::Integer> fldTStep = makeFieldDef("TStep",FieldType::Integer()).notNull();
24  const FieldDef<FieldType::Integer> fldPopId = makeFieldDef("PopId",FieldType::Integer()).notNull();
25  const FieldDef<FieldType::Integer> fldGroup = makeFieldDef("PopGroup",FieldType::Integer()).notNull();
26 
27  const FieldDef<FieldType::Real> fldNz = makeFieldDef("Nz",FieldType::Real());
28  const FieldDef<FieldType::Real> fldC = makeFieldDef("Catch",FieldType::Real());
29  const FieldDef<FieldType::Real> fldD = makeFieldDef("Discard",FieldType::Real());
30  const FieldDef<FieldType::Real> fldravF = makeFieldDef("RunningF",FieldType::Real());
31  const FieldDef<FieldType::Real> fldF = makeFieldDef("F",FieldType::Real());
32  const FieldDef<FieldType::Real> fldM = makeFieldDef("M",FieldType::Real());
33  const FieldDef<FieldType::Real> fldNa = makeFieldDef("Na",FieldType::Real());
34  const FieldDef<FieldType::Real> fldW = makeFieldDef("W",FieldType::Real());
35  const FieldDef<FieldType::Real> fldMat = makeFieldDef("Mat",FieldType::Real());
36  const FieldDef<FieldType::Real> fldSSB = makeFieldDef("SSB",FieldType::Real());
37  const FieldDef<FieldType::Real> fldFFmsy = makeFieldDef("FFmsy",FieldType::Real());
38  const FieldDef<FieldType::Real> fldPropMature = makeFieldDef("PropMature",FieldType::Real());
39 
40 
41  PopDynTable(std::shared_ptr<sqlite::SQLiteStorage> db, std::string name);
42  ~PopDynTable() noexcept;
43 
44  void dropAndCreate();
45  void insert (int tstep, int popid, Population *pop);
46 };
47 
48 #endif // POPDYNTABLE_H
Definition: sqliteoutputstorage.h:33
Definition: popdyntable.h:17
int tstep
Definition: main.cpp:205
Definition: Population.h:34
#define COMMONSSHARED_EXPORT
Definition: commons_global.h:23
Definition: popdyntable.cpp:6