2
0

Decl.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef DECL_H
  2. #define DECL_H
  3. #include <QString>
  4. #include <QPair>
  5. #include <QMap>
  6. #include <QObject>
  7. namespace experimental {
  8. using ColName = QString;
  9. using ColData = QString;
  10. using TableName = QString;
  11. using RowId = int;
  12. using TableNames = QStringList;
  13. /// [G]: May lead to some confusion. TableData suggest data for the entire table.
  14. /// but in reallity it is data per column *of single row* (unless i misunderstand)
  15. using TableData = QMap<ColName, ColData>;
  16. using ColumnData = QPair<ColName, ColData>;
  17. using ColumnNames = QStringList;
  18. using TableColumns = QMap<TableName, ColumnNames>;
  19. /// [G]: Needs some work. Inheriting from QPair may be helpful but
  20. /// may also be overkill. Lets determine the specific uses of DataPosition
  21. /// and provide our own interface i would say.
  22. struct DataPosition : QPair<TableName, RowId> {
  23. TableName tableName;
  24. RowId rowId;
  25. DataPosition()
  26. : tableName(first), rowId(second)
  27. {}
  28. DataPosition(TableName table_name, RowId row_id)
  29. : QPair<TableName, RowId>::QPair(table_name, row_id),
  30. tableName(first), rowId(second)
  31. {}
  32. DataPosition(const DataPosition& other) = default;
  33. DataPosition& operator=(const DataPosition& other) = default;
  34. };
  35. auto const DEFAULT_PILOT_POSITION = DataPosition("pilots", 0);
  36. }
  37. #endif // DECL_H