EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
continent.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// --- Continents --- //
15{
16public:
17 Continent();
18 ~Continent();
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
30 // Item id numbers
31 enum ENUM_ITEM_ID { AFRICA, ASIA, EUROPE, NORTH_AMERICA, OCEANIA, SOUTH_AMERICA };
32
33private:
34 struct Data;
35 std::unique_ptr<Data> data_;
36
37 // Get data
38 QVariant internalData(const qint32 column, const qint32 role) const override;
39
40 // Set data
41 bool setInternalData(const qint32 column,
42 const QVariant &value,
43 const qint32 role,
44 std::vector<qint32> &modified_columns) override;
45};
46
47} // namespace ehm_dal::schema
48
49
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: continent.h:15
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: continent.h:28
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.