EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
table_attributes.h
1#pragma once
2
3// Application headers
4#include "include/tables/table_index.h"
5#include "include/tables/table_type.h"
6
7// Qt headers
8class QDataStream;
9#include <QString>
10
11namespace ehm_dal::tables {
13{
14public:
15 TableAttributes(const QString &name = QString(),
16 const TableIndex table_id = TableIndex::NO_TABLE,
18
19 // File i/o
20 quint32 readTableHeader(QDataStream &in);
21 bool writeTableHeader(QDataStream &out);
22
23 // Get data
28 inline qint16 gameTableId() const { return game_table_id_; }
34 inline TableIndex id() const { return ehm_dal_table_id_; }
39 inline QString name() const { return name_; }
40
41 // Get data - table type
42 bool isDatabaseTable() const;
43 bool isFlagBitmaskTable() const;
44 bool isFlagStandardTable() const;
45 bool isFlagTable() const;
50 inline TableType type() const { return type_; }
51
52private:
53 static constexpr qint16 NO_TABLE_ID{-1}; // Private magic number
54
55 // File/record attributes
56 qint64 file_position_{-1};
57 quint32 record_count_{0};
58
59 // Table attributes
60 TableIndex ehm_dal_table_id_; // Internal ehm_db table id
61 qint16 game_table_id_{NO_TABLE_ID}; // EHM database id used in database.db
62 const QString name_;
63 const TableType type_;
64};
65
66} // namespace ehm_dal::tables
Definition: table_attributes.h:13
QString name() const
Returns the name of the table.
Definition: table_attributes.h:39
TableIndex id() const
Returns the id of the table. The id used to distinguish between tables in EHM DAL....
Definition: table_attributes.h:34
TableType type() const
Returns the type of the table.
Definition: table_attributes.h:50
qint16 gameTableId() const
Returns the internal EHM table id of the table.
Definition: table_attributes.h:28
namespace ehm_dal::tables
Definition: column.h:4
TableType
The TableType enum denotes different types of database table.
Definition: table_type.h:12
TableIndex
The TableIndex enum represents the id number of each table within the database.
Definition: table_index.h:14