EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
schedule_date.h
1#pragma once
2
3// Application headers
4#include "include/database/schema/comp_basic_rules/comp_stage/stage_type.h"
5#include "include/schema/abstract_table_item.h"
6
7namespace ehm_dal::schema {
8// --- Schedule dates --- //
10{
11public:
12 // Constructor
15 ScheduleDate(const ScheduleDate &other);
17
18 // File I/O
19 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
20 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
21
22 // Initialisation
23 inline bool init() override { return false; }
24 void setStageType(const ehm_dal::flags::StageType &stage_type);
25
26 // Operator overloading
27 ScheduleDate &operator=(ScheduleDate rhs);
28 auto operator<=>(const ScheduleDate &rhs) const;
29 bool operator<(const ScheduleDate &rhs) const;
30
31 /*
32 // Get data
33 QVariant data(const qint32 column, const qint32 role) const override;
34
35 // Operator overloading
36 bool operator<(const ScheduleDate &rhs) const;
37
38 // Set data
39 void setBaseData(const qint32 column,
40 const QVariant &value,
41 const qint32 role,
42 std::vector<qint32> &modified_columns);
43 void setCupData(const qint32 column,
44 const QVariant &value,
45 const qint32 role,
46 std::vector<qint32> &modified_columns);
47 void setData(const qint32 column,
48 const QVariant &value,
49 const qint32 role,
50 std::vector<qint32> &modified_columns) override;
51 inline void setStageType(const StageType &stage_type) { parent_stage_type = &stage_type; }
52*/
53
54private:
55 struct Data;
56 std::unique_ptr<Data> data_;
57
58 // --- Cup Dates --- //
59 // round prize money definitions
60 enum ENUM_PRIZE_MONEY {
61 ROUND_APPEARANCE_MONEY = 0,
62 ROUND_WIN_MONEY,
63 ROUND_LOSE_MONEY,
64 MAX_ROUND_PRIZES
65 };
66
67 // Get data
68 /*
69 QVariant baseData(const qint32 column, const qint32 role) const;
70 QVariant cupData(const qint32 column, const qint32 role) const;*/
71};
72} // namespace ehm_dal::schema
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
Definition: stage_type.h:8
The AbstractTableItem class represents a row in a Table with no primary key (id/uid) field.
Definition: abstract_table_item.h:23
Definition: schedule_date.h:10
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: schedule_date.h:23
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.