EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
ruling_body.h
1#pragma once
2
3// Application headers
4#include "include/schema/abstract_id_table_item.h"
5
6// Qt headers
7class QDataStream;
8#include <memory>
9
10namespace ehm_dal::schema {
11// --- Ruling body --- //
13{
14public:
15 // Constructor
16 RulingBody();
18
19 // File i/o
20 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
21 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
22
23 // Get data
24 bool isSpecialItem() const;
25 QString text() const override;
26
27 // Initialisation
28 bool init() override;
29
30 // Operator overloading
31 auto operator<=>(const RulingBody &rhs) const;
32
33 // Indexes
34 enum ENUM_RULING_BODY_INDEXES {
35 RBI_INTERNATIONAL = 0,
36 RBI_EUROPE_CONTINENTAL = 1,
37 RBI_NORTH_AMERICAN_CONTINENTAL = 2,
38 RBI_ASIA_CONTINENTAL = 3,
39 RBI_DOMESTIC_RULING_BODY_BASE
40 = 4 // this is the starting point for the nation/comp specific ruling bodies
41 };
42
43private:
44 struct Data;
45 std::unique_ptr<Data> data_;
46
47 // Get data
48 QVariant internalData(const qint32 column, const qint32 role) const override;
49
50 // Set data
51 bool setInternalData(const qint32 column,
52 const QVariant &value,
53 const qint32 role,
54 std::vector<qint32> &modified_columns) override;
55};
56} // namespace ehm_dal::schema
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
The AbstractIdTableItem class represents a row in a Table with an id field.
Definition: abstract_id_table_item.h:26
Definition: ruling_body.h:13
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 init() override
Initialises the table item members. This only needs to be called once per item.
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.