EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
staff.h
1#pragma once
2
3// Application headers
4#include "include/database/schema/private/person.h"
5
6// Qt headers
7class QDataStream;
8#include <memory>
9
10namespace ehm_dal::schema {
11//class ContractDetails
12class NonPlayerData;
13class PlayerData;
14//class PlayerInfo;
15//class StaffInfo;
16class StaffPreferences;
17
18// --- Staff --- //
20{
21public:
22 Staff();
23 ~Staff();
24
25 // Child data
26 void addChildItem(std::shared_ptr<AbstractTableItem> item,
27 const ehm_dal::tables::TableIndex child_table) override;
28 QVariant childData(const QModelIndex &index,
29 qint32 role,
30 column_data::ColumnData *column_data,
31 const ehm_dal::tables::TableIndex child_table) const override;
32 qint32 childItemId(const ehm_dal::tables::TableIndex child_table) const override;
33 qint32 childRowCount(const ehm_dal::tables::TableIndex child_table) const override;
34 bool setChildData(const QModelIndex &index,
35 const QVariant &value,
36 const qint32 role,
37 std::vector<qint32> &modified_columns,
39 const ehm_dal::tables::TableIndex child_table) override;
40
41 // File i/o
42 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
43 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
44
45private:
46 struct Data;
47 std::unique_ptr<Data> data_;
48
49 // Get data
50 bool deletable() const override;
51 QVariant internalData(const qint32 column, const qint32 role) const override;
52
53 // Initialisation
54 bool initInternalData() override;
55
56 // Set data
57 bool setInternalData(const qint32 column,
58 const QVariant &value,
59 const qint32 role,
60 std::vector<qint32> &modified_columns) override;
61};
62
63} // namespace ehm_dal::schema
64
65
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
Definition: person.h:21
Definition: staff.h:20
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...
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.
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 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.
qint32 childItemId(const ehm_dal::tables::TableIndex child_table) const override
Returns the item id number for the child data under the related child_table.
TableIndex
The TableIndex enum represents the id number of each table within the database.
Definition: table_index.h:14