Agroeye  1.0
DatabaseColumn.h
Go to the documentation of this file.
1 #ifndef DATABASECOLUMN_H
2 #define DATABASECOLUMN_H
3 
4 #include <string>
5 
6 namespace agroeye {
7 namespace handlers {
8 
12 enum class ColumnType {
13  NONE,
14  INTEGER,
15  REAL,
16  TEXT,
17  BLOB,
18  GEOMETRY
19 };
20 
21 
25 class DbColumn {
26 public:
27  DbColumn() {};
35  DbColumn(const std::string& aName, const ColumnType& aType, bool isPrimary = false) :
36  name(aName), type(aType), primaryKey(isPrimary) {};
37 
42  std::string getName() const { return name; };
43 
48  ColumnType getType() const { return type; };
49 
54  bool isPrimaryKey() const { return primaryKey; };
55 private:
56  std::string name;
58  bool primaryKey {false};
59 
60 };
61 
62 } // namespace handlers2
63 } // namespace agroeye
64 
65 
66 #endif
DbColumn(const std::string &aName, const ColumnType &aType, bool isPrimary=false)
Constructor setting parameters of column.
Definition: DatabaseColumn.h:35
ColumnType getType() const
Gets the type of data stored in column.
Definition: DatabaseColumn.h:48
Definition: ContainerMath.h:11
Encapsulation of Sqlite3/Spatialite table.
Definition: DatabaseColumn.h:25
DbColumn()
Definition: DatabaseColumn.h:27
bool isPrimaryKey() const
Checks if column is primary key *.
Definition: DatabaseColumn.h:54
std::string getName() const
Get the name of column.
Definition: DatabaseColumn.h:42
ColumnType
Type of data stored by column.
Definition: DatabaseColumn.h:12