Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
|
The AbstractData class is provide base functions for transport data by network For create you own package you need to inherited from this class. Simple Example: More...
#include <abstractdata.h>
Public Member Functions | |
~AbstractData () override | |
virtual unsigned short | cmd () const =0 |
cmd - This is command of this object, (for generate cmd use macross QH_PACKAGE) | |
virtual QString | cmdString () const =0 |
cmdString - This is command string of this object, (for generate cmd use macross QH_PACKAGE) | |
virtual bool | toPackage (Package &package, const DistVersion &reqVersion, unsigned int triggerHash=0) const |
toPackage This method convert this class object to the package. For more info see Package class. | |
virtual bool | isValid () const |
isValid This method check current object to valid. | |
QString | toString () const override |
toString - Return a string implementation for this object. | |
template<class C , class... Args> | |
C * | create (Args &&... args) const |
create - This is factory method for create a new object. | |
void | fromPakcage (const Package &pkg) |
fromPakcage - This method initialize the current object from a package class object. | |
Public Member Functions inherited from QH::StreamBase | |
StreamBase () | |
virtual | ~StreamBase () |
bool | fromBytes (const QByteArray &data) |
fromBytes This method provide initialization of object from byte array. | |
QByteArray | toBytes () const |
toBytes This method convert a current object to bytes array. | |
bool | fromBase64 (const QString &data) |
fromBase64 This method provide initialization of object from the base64 string. | |
bool | fromBase64 (const QByteArray &data) |
fromBase64 This method provide initialization of object from the base64 string. | |
QByteArray | toBase64 () const |
toBase64 This method convert a current object to the base64 string. | |
template<class T > | |
T & | copy (const StreamBase &right) |
copy This is base copy method for all StreamBase structures. Default implementation it is copy from byteArray. | |
template<class T > | |
bool | compare (const T &right) |
compare This method compare array signatures of this and right objects. | |
Static Public Member Functions | |
static unsigned int | command () |
command This static method that return glaball code of this object. | |
static QString | commandText () |
commandText This method return text of package command | |
Protected Member Functions | |
AbstractData () | |
AbstractData - Base constructor of this object. | |
Protected Member Functions inherited from QH::StreamBase | |
virtual int | parsingVersion () const |
parsingVersion this method return parsing version of Qt. By Default is 0 (last available parsing). see https://doc.qt.io/qt-6/qdatastream.html#Version-enum | |
virtual QDataStream & | fromStream (QDataStream &stream)=0 |
fromStream This method should be read all bytes from the stream object and full the current object. | |
virtual QDataStream & | toStream (QDataStream &stream) const =0 |
fromStream This method should be write all members of the current object to the stream object. | |
virtual unsigned int | typeId () const |
typeId This method return id of type. | |
The AbstractData class is provide base functions for transport data by network For create you own package you need to inherited from this class. Simple Example:
This is simple implementation of package for transport text data. You need to override 2 serialization methods (fromStream and toStream).
Definition at line 82 of file abstractdata.h.
|
override |
Definition at line 55 of file abstractdata.cpp.
|
explicitprotected |
AbstractData - Base constructor of this object.
Definition at line 18 of file abstractdata.cpp.
|
pure virtual |
cmd - This is command of this object, (for generate cmd use macross QH_PACKAGE)
Implemented in QH::PKG::APIVersion, and QH::PKG::VersionIsReceived.
|
pure virtual |
cmdString - This is command string of this object, (for generate cmd use macross QH_PACKAGE)
Implemented in QH::PKG::APIVersion, and QH::PKG::VersionIsReceived.
|
inlinestatic |
command This static method that return glaball code of this object.
Definition at line 149 of file abstractdata.h.
|
inlinestatic |
commandText This method return text of package command
Definition at line 155 of file abstractdata.h.
|
inline |
create - This is factory method for create a new object.
args | - List of arguments for create object. |
Definition at line 132 of file abstractdata.h.
void QH::PKG::AbstractData::fromPakcage | ( | const Package & | pkg | ) |
fromPakcage - This method initialize the current object from a package class object.
pkg | - Input package value. |
Definition at line 51 of file abstractdata.cpp.
|
virtual |
isValid This method check current object to valid.
Reimplemented in QH::PKG::APIVersion, QH::PKG::BigDataBase, QH::PKG::BigDataHeader, QH::PKG::BigDataPart, QH::PKG::DataPack< Package >, QH::PKG::DBObject, QH::PKG::DBObjectsRequest< T >, and QH::PKG::Ping.
Definition at line 40 of file abstractdata.cpp.
|
virtual |
toPackage This method convert this class object to the package. For more info see Package class.
package | This is return value of Package class. |
reqVersion | This is required version. This method create package of the needed version. |
triggerHash | This is hash of the package the current class is responding to. |
Reimplemented in QH::PKG::MultiversionData.
Definition at line 21 of file abstractdata.cpp.
|
override |
toString - Return a string implementation for this object.
Definition at line 44 of file abstractdata.cpp.