Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
package.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 QuasarApp.
3 * Distributed under the lgplv3 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 ABSTRACTPACKAGE_H
9#define ABSTRACTPACKAGE_H
10#include "header.h"
11#include "heart_global.h"
12#include "streambase.h"
13
14#include <QByteArray>
15
16namespace QH {
17
24
25public:
33 QByteArray data;
34
35 Package();
36 virtual ~Package() = default;
37
43 virtual bool isValid() const;
44
48 virtual void reset();
49
54 QString toString() const;
55
60 unsigned int calcHash() const;
61
66 static unsigned int maximumSize();
67
68 // StreamBase interface
69protected:
70 QDataStream &fromStream(QDataStream &stream) override;
71 QDataStream &toStream(QDataStream &stream) const override;
72};
73
74}
75#endif // ABSTRACTPACKAGE_H
The Package struct. This is base structure for transporting data by network between QH nodes....
Definition package.h:23
QByteArray data
data This is source data of package.
Definition package.h:33
Header hdr
hdr This is header of package. For more information see the Header struct.
Definition package.h:29
virtual ~Package()=default
The StreamBase class add support streaming data for all children classes. For correctly working all s...
Definition streambase.h:28
#define HEARTSHARED_EXPORT
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
The Header struct 32 bytes.
Definition header.h:19