EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
uid_pointer.h
1#pragma once
2
3// Application headers
4#include "include/database/pointer/pointer.h"
5
6namespace ehm_dal::data_types {
10class UidPointer : public Pointer
11{
12public:
13 UidPointer();
15 const qint32 record_uid = PointerFlags::NULL_POINTER);
16 virtual ~UidPointer();
17
18 // File i/o
23 void readFromShort(QDataStream &in) override;
28 void writeToShort(QDataStream &out) const override;
29
30 // Get data - pointer
31 qint32 uid() const;
32
33private:
34 qint32 uid_;
35
36 // File i/o
37 friend QDataStream &operator>>(QDataStream &in, UidPointer &data);
38 friend QDataStream &operator<<(QDataStream &out, const UidPointer &data);
39
40 // Initialisation
41 virtual void initPointer() override;
42};
43
44// File i/o
45QDataStream &operator>>(QDataStream &in, UidPointer &data);
46QDataStream &operator<<(QDataStream &out, const UidPointer &data);
47
48} // namespace ehm_dal::data_types
The Pointer class represents a pointer to a table item based on ID.
Definition: pointer.h:21
The UidPointer class represents a pointer to a table item based on UID.
Definition: uid_pointer.h:11
void readFromShort(QDataStream &in) override
Reads a qint16 as the UidPointer value.
void writeToShort(QDataStream &out) const override
Writes the UidPointer value as a qint16.
namespace ehm_dal::data_types
Definition: attribute.h:6
@ NULL_POINTER
Definition: pointer_flags.h:9
TableIndex
The TableIndex enum represents the id number of each table within the database.
Definition: table_index.h:14