4#include "include/database/pointer/pointer_flags.h"
5#include "include/database/pointer/private/abstract_pointer.h"
6#include "include/tables/abstract_table.h"
7#include "include/tables/table_index.h"
20 AbstractPointer<qint32, ehm_dal::tables::TableIndex, ehm_dal::tables::AbstractTable>
42 QVariant data(
const qint32 column, qint32 role)
const override;
43 qint32 id()
const override;
44 QString text()
const override;
47 std::shared_ptr<ehm_dal::tables::AbstractTable> constTable()
const override;
48 std::shared_ptr<ehm_dal::tables::AbstractTable> table()
override;
58 void setData(
const QVariant &value,
const qint32 role)
override;
61 std::weak_ptr<ehm_dal::schema::AbstractTableItem> ptr_;
64 friend QDataStream &operator>>(QDataStream &in,
Pointer &data);
65 friend QDataStream &operator<<(QDataStream &out,
const Pointer &data);
72QDataStream &operator>>(QDataStream &in,
Pointer &data);
73QDataStream &operator<<(QDataStream &out,
const Pointer &data);
The AbstractPointer class represents a pointer to a table item.
Definition: abstract_pointer.h:19
QVariant data(const qint32 role) const
Returns the data stored under the given role. Qt::DisplayRole returns the item's display text and Qt:...
Definition: abstract_pointer.h:180
The Pointer class represents a pointer to a table item.
Definition: pointer.h:21
void readFromShort(QDataStream &in)
Reads a qint16 as the Pointer value.
virtual void init()
Initialise/connect the Pointer to the item to be pointed to. This need only be done once.
void writeToShort(QDataStream &out) const
Writes the Pointer 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