openPilotLog
decl.h
1 #ifndef DECL_H
2 #define DECL_H
3 
4 #include <QString>
5 #include <QPair>
6 #include <QMap>
7 #include <QObject>
8 
9 namespace experimental {
10 
11 using ColName = QString;
12 using ColData = QVariant;
13 using TableName = QString;
14 using RowId = int;
15 
16 using TableNames = QStringList;
20 using TableData = QMap<ColName, ColData>;
21 using ColumnData = QPair<ColName, ColData>;
22 using ColumnNames = QStringList;
23 using TableColumns = QMap<TableName, ColumnNames>;
24 
31 struct DataPosition : QPair<TableName, RowId> {
32  TableName tableName;
33  RowId rowId;
34  DataPosition()
35  : tableName(first), rowId(second)
36  {}
37  DataPosition(TableName table_name, RowId row_id)
38  : QPair<TableName, RowId>::QPair(table_name, row_id),
39  tableName(first), rowId(second)
40  {}
41  DataPosition(const DataPosition& other) = default;
42  DataPosition& operator=(const DataPosition& other) = default;
43 };
44 auto const DEFAULT_PILOT_POSITION = DataPosition("pilots", 0);
45 auto const DEFAULT_TAIL_POSITION = DataPosition("tails", 0);
46 auto const DEFAULT_AIRCRAFT_POSITION = DataPosition("aircraft", 0);
47 auto const DEFAULT_FLIGHT_POSITION = DataPosition("flights", 0);
48 
49 }
50 
51 #endif // DECL_H
experimental::DataPosition
Definition: decl.h:31