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;
45 std::weak_ptr<ehm_dal::schema::AbstractIdTableItem> weakPointer() {
return ptr_; }
48 std::shared_ptr<ehm_dal::tables::AbstractTable> constTable()
const override;
49 std::shared_ptr<ehm_dal::tables::AbstractTable> table()
override;
65 void setData(
const QVariant &value,
const qint32 role)
override;
68 std::weak_ptr<ehm_dal::schema::AbstractIdTableItem> ptr_;
72 friend QDataStream &operator>>(QDataStream &in,
Pointer &data);
73 friend QDataStream &operator<<(QDataStream &out,
const Pointer &data);
76 virtual void initPointer();
80QDataStream &operator>>(QDataStream &in,
Pointer &data);
81QDataStream &operator<<(QDataStream &out,
const Pointer &data);
The AbstractPointer class represents a pointer to a table item.
Definition: abstract_pointer.h:22
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:197
The Pointer class represents a pointer to a table item based on ID.
Definition: pointer.h:21
virtual void writeToShort(QDataStream &out) const
Writes the Pointer value as a qint16.
virtual void init()
Initialise/connect the Pointer to the item to be pointed to. This need only be done once.
virtual void readFromShort(QDataStream &in)
Reads a qint16 as the Pointer value.
void init(const ehm_dal::tables::TableIndex table_id)
Set the table to table_id and initialise/connect the Pointer to the item to be pointed to....
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