EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
person.h
1#pragma once
2
3
4// Application headers
5#include "include/data_types/date/year.h"
6#include "include/schema/abstract_uid_table_item.h"
7
8// Qt headers
9class QDataStream;
10#include <memory>
11
12namespace ehm_dal::data_types {
13class Date;
14class Pointer;
15class NamePointer;
16}
17
18namespace ehm_dal::schema {
19
21{
22public:
23 Person();
24 ~Person();
25
26 // Bio data - age
27 qint32 age() const;
28
29 // Get data
30 QString text() const override;
31
32 // Initialisation
33 bool init() override;
34
35 // Operator overloading
36 bool operator<(const Person &rhs) const;
37
38protected:
39 // Bio data - age
40 ehm_dal::data_types::Date &dateOfBirth();
41 data_types::Year<qint16> &yearOfBirth();
42 // Bio data - geography
43 ehm_dal::data_types::Pointer &birthplace();
44 ehm_dal::data_types::Pointer &nationality();
45 // Bio data - name
48
49 // Get data
50 QVariant personData(const qint32 column, qint32 role) const;
51
52 // Set data
53 bool setPersonData(const qint32 column,
54 const QVariant &value,
55 qint32 role,
56 std::vector<qint32> &modified_columns);
57
58private:
59 struct Data;
60 std::unique_ptr<Data> base_data_;
61
62 // Initialisation
63 virtual bool initInternalData() = 0;
64
65 // Bio data - age
66 bool validateYearOfBirth();
67};
68
69} // namespace ehm_dal::schema
70
71
The Date class acts as a QDate wrapper for EHM format SI_Date.
Definition: date.h:17
The NamePointer class acts as a pointer to a Name table. The name string is buffered and is then resy...
Definition: name_pointer.h:18
The Pointer class represents a pointer to a table item.
Definition: pointer.h:21
The Year class represents a calendar year value. Only qint16 and quint16 are permissible.
Definition: year.h:19
The AbstractUidTableItem class represents a row in a Table with id and uid fields.
Definition: abstract_uid_table_item.h:11
Definition: person.h:21
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...
bool init() override
Initialises the table item members. This only needs to be called once per item.
namespace ehm_dal::data_types
Definition: attribute.h:6