EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
player_data.h
1#pragma once
2
3// Application headers
4#include "include/schema/abstract_table_item.h"
5
6// Qt headers
7class QDataStream;
8#include <memory>
9
10namespace ehm_dal::schema {
11
12// --- Player attributes --- //
14{
15public:
16 PlayerData();
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 double bodyMassIndex() const;
25 QString text() const override;
26
27 // Initialisation
28 inline bool init() override { return false; }
29
30 // Operator overloading
31 PlayerData &operator=(PlayerData &&rhs);
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 AbstractTableItem class represents a row in a Table with an id field.
Definition: abstract_table_item.h:31
Definition: player_data.h:14
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: player_data.h:28
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.
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...