EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
club_competition.h
1#pragma once
2
3// Application headers
4#include "include/schema/abstract_uid_table_item.h"
5
6// Qt headers
7class QDataStream;
8#include <memory>
9
10namespace ehm_dal::schema {
11
12// --- Club competitions --- //
14{
15public:
18
19 // Child data
20 void addChildItem(std::shared_ptr<AbstractTableItem> item,
21 const ehm_dal::tables::TableIndex child_table) override;
22 QVariant childData(const QModelIndex &index,
23 qint32 role,
24 column_data::ColumnData *column_data,
25 const ehm_dal::tables::TableIndex child_table) const override;
26 qint32 childRowCount(const ehm_dal::tables::TableIndex child_table) const override;
27 bool setChildData(const QModelIndex &index,
28 const QVariant &value,
29 const qint32 role,
30 std::vector<qint32> &modified_columns,
32 const ehm_dal::tables::TableIndex child_table) override;
33
34 // File i/o
35 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
36 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
37
38 // Get data
39 QStringList identifierList() const override;
40 QString text() const override;
41
42 // Initialisation
43 bool init() override;
44
45 // Item id numbers
46 enum ENUM_ITEM_ID {
47 NATIONAL_HOCKEY_LEAGUE_CLUB_COMPETITION_ID = 0,
48 };
49
50 // Operator overloading
51 bool operator<(const ClubCompetition &rhs) const;
52
53private:
54 struct Data;
55 std::unique_ptr<Data> data_;
56
57 // Get data
58 QVariant internalData(const qint32 column, const qint32 role) const override;
59
60 // Set data
61 bool setInternalData(const qint32 column,
62 const QVariant &value,
63 const qint32 role,
64 std::vector<qint32> &modified_columns) override;
65};
66
67} // namespace ehm_dal::schema
68
69
The ColumnData class represents a container of ehm_dal::column_data::Column and attributes relating t...
Definition: column_data.h:18
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: club_competition.h:14
QStringList identifierList() const override
Returns a list of all of the item's identifiers for matching against. This includes the main identifi...
QVariant childData(const QModelIndex &index, qint32 role, column_data::ColumnData *column_data, const ehm_dal::tables::TableIndex child_table) const override
Returns child data stored under the given role for the selected index.
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.
bool setChildData(const QModelIndex &index, const QVariant &value, const qint32 role, std::vector< qint32 > &modified_columns, ehm_dal::column_data::ColumnData *column_data, const ehm_dal::tables::TableIndex child_table) override
Sets the role data for the child item at index to value.
bool init() override
Initialises the table item members. This only needs to be called once per item.
qint32 childRowCount(const ehm_dal::tables::TableIndex child_table) const override
Returns the number of related child items in respect of child_table.
void addChildItem(std::shared_ptr< AbstractTableItem > item, const ehm_dal::tables::TableIndex child_table) override
Adds the child item item from the child_table to the present tree table. This represents a tree relat...
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.
TableIndex
The TableIndex enum represents the id number of each table within the database.
Definition: table_index.h:14