EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
database_header.h
1#pragma once
2
3
4// Application headers
5#include "include/schema/abstract_table_item.h"
6
7// Qt headers
8class QDataStream;
9#include <memory>
10
11namespace ehm_dal::schema {
12
13// --- Database header data --- //
15{
16public:
19
20 // File i/o
21 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
22 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
23
24 // Get data
25 QString text() const override;
26
27 // Initialisation
28 inline bool init() override { return false; }
29
30private:
31 struct Data;
32 std::unique_ptr<Data> data_;
33
34 // Get data
35 QVariant internalData(const qint32 column, const qint32 role) const override;
36
37 // Set data
38 bool setInternalData(const qint32 column,
39 const QVariant &value,
40 const qint32 role,
41 std::vector<qint32> &modified_columns) override;
42};
43
44} // namespace ehm_dal::schema
45
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
The AbstractTableItem class represents a row in a Table with an id field.
Definition: abstract_table_item.h:31
Definition: database_header.h:15
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: database_header.h:28
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...