EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
nation.h
1#pragma once
2
3
4// Application headers
5#include "include/schema/abstract_uid_table_item.h"
6
7// Qt headers
8class QDataStream;
9#include <memory>
10
11namespace ehm_dal::schema {
12
13// --- Nations --- //
15{
16public:
17 Nation();
18 ~Nation();
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 bool init() override;
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
46
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
The AbstractUidTableItem class represents a row in a Table with id and uid fields.
Definition: abstract_uid_table_item.h:11
Definition: nation.h:15
bool init() override
Initialises the table item members. This only needs to be called once per item.
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...
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.