Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
package.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018-2025 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
16
namespace
QH
{
17
23
class
HEARTSHARED_EXPORT
Package
:
public
StreamBase
{
24
25
public
:
29
Header
hdr
;
33
QByteArray
data
;
34
35
Package
();
36
virtual
~Package
() =
default
;
37
43
bool
isValid
()
const override
;
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
69
protected
:
70
QDataStream &
fromStream
(QDataStream &stream)
override
;
71
QDataStream &
toStream
(QDataStream &stream)
const override
;
72
};
73
74
}
75
#endif
// ABSTRACTPACKAGE_H
QH::Package::calcHash
unsigned int calcHash() const
calcHash This method recalc hash sum for this pacakge.
Definition
package.cpp:44
QH::Package::fromStream
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
Definition
package.cpp:53
QH::Package::data
QByteArray data
data This is source data of package.
Definition
package.h:33
QH::Package::hdr
Header hdr
hdr This is header of package. For more information see the Header struct.
Definition
package.h:29
QH::Package::Package
Package()
Definition
package.cpp:14
QH::Package::isValid
bool isValid() const override
isValid This method validation a current package. Default implementation is checked a header and comp...
Definition
package.cpp:18
QH::Package::toString
QString toString() const
toString This method convert a package information to a string label.
Definition
package.cpp:38
QH::Package::reset
virtual void reset()
reset This method reset all data and set for package invalid status.
Definition
package.cpp:33
QH::Package::maximumSize
static unsigned int maximumSize()
maximumSize This method return maximu size of pacakge. If pacakge large the maximum size then package...
Definition
package.cpp:49
QH::Package::toStream
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
Definition
package.cpp:67
QH::Package::~Package
virtual ~Package()=default
QH::StreamBase::StreamBase
StreamBase()
header.h
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
streambase.h
QH::Header
The Header struct 32 bytes.
Definition
header.h:19
src
public
package.h
Generated by
1.18.0