Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
universaldata.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023-2025 QuasarApp.
3 * Distributed under the GPLv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#ifndef UNIVERSALDATA_H
9#define UNIVERSALDATA_H
10
11#include "abstractdata.h"
12
13namespace QH {
14namespace PKG {
15
50class HEARTSHARED_EXPORT UniversalData: public QH::PKG::AbstractData
51{
52public:
54
60 void setValue(int key, const QVariant& value);
61
66 const QVariant& value(int key, const QVariant& defaultVal = {}) const;
67
73 QVariant* ref(int key);
74
75protected:
76 QDataStream &fromStream(QDataStream &stream) override final;
77 QDataStream &toStream(QDataStream &stream) const override final;
78
79private:
80 QHash<int, QVariant> _data;
81};
82
83}
84}
85
86#endif // UNIVERSALDATA_H
The AbstractData class is provide base functions for transport data by network For create you own pac...
void setValue(int key, const QVariant &value)
setValue This method sets new value for the filed. Works like a insert method of the QMap
const QVariant & value(int key, const QVariant &defaultVal={}) const
value this method return value of the key.
QDataStream & toStream(QDataStream &stream) const override final
fromStream This method should be write all members of the current object to the stream object.
QDataStream & fromStream(QDataStream &stream) override final
fromStream This method should be read all bytes from the stream object and full the current object.
QVariant * ref(int key)
ref This method return pointer to the object If this object is not exists return nullptr
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition heart.h:211
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13