EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
tv_date.h
1#pragma once
2
3// Application headers
4#include "include/schema/abstract_table_item.h"
5
6namespace ehm_dal::schema {
7// --- Television Date --- //
13{
14public:
15 // Constructor
16 TvDate();
17 ~TvDate();
18 TvDate(const TvDate &other);
19 TvDate(TvDate &&other);
20
21 // Definitions for television types
22 enum ENUM_TV_DATES {
23 TV_NONE = -1,
24 TV_REGIONAL,
25 TV_NATIONAL,
26 TV_SATELLITE,
27 TV_SILENT, // hide rescheduling message doesn't appear
28 TV_DONT_MOVE_ANY_MATCHES,
29 TV_TYPES_MAX,
30 MAX_TV_DATES // 6
31 };
32
33 // File I/O
34 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
35 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
36
37 // Initialisation
38 inline bool init() override { return false; }
39
40 // Operator overloading
41 TvDate &operator=(TvDate rhs);
42 auto operator<=>(const TvDate &rhs) const;
43 bool operator<(const TvDate &rhs) const;
44
45 /*
46 // Get data
47 QVariant data(const qint32 column, const qint32 role) const override;
48
49 // Set data
50 void setData(const qint32 column,
51 const QVariant &value,
52 const qint32 role,
53 std::vector<qint32> &modified_columns) override;
54*/
55 // Operator overloading
56 //bool operator<(const TvDate &rhs) const;
57
58private:
59 struct Data;
60 std::unique_ptr<Data> data_;
61};
62} // namespace ehm_dal::schema
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
The AbstractTableItem class represents a row in a Table with no primary key (id/uid) field.
Definition: abstract_table_item.h:23
The TvDate class handles data needed for scheduling games between different arenas on the same schedu...
Definition: tv_date.h:13
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: tv_date.h:38
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.