DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
popquotastable.h
Go to the documentation of this file.
1 #ifndef POPQUOTASTABLE_H
2 #define POPQUOTASTABLE_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 PopQuotasTable : 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> fldQuotasUptake = makeFieldDef("QuotasUptake",FieldType::Real());
28  const FieldDef<FieldType::Real> fldQuotas = makeFieldDef("Quotas",FieldType::Real());
29  const FieldDef<FieldType::Real> fldChoking = makeFieldDef("Choking",FieldType::Real());
30 
31  PopQuotasTable(std::shared_ptr<sqlite::SQLiteStorage> db, std::string name);
32  ~PopQuotasTable() noexcept;
33 
34  void dropAndCreate();
35  void insert (int tstep, int popid, Population *pop);
36 };
37 
38 #endif // POPQUOTASTABLE_H
Definition: sqliteoutputstorage.h:33
int tstep
Definition: main.cpp:205
Definition: Population.h:34
Definition: popquotastable.h:17
Definition: popquotastable.cpp:6
#define COMMONSSHARED_EXPORT
Definition: commons_global.h:23