Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
header.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 ABSTRACTHEADER_H
9
#define ABSTRACTHEADER_H
10
#include "heart_global.h"
11
12
13
namespace
QH
{
14
18
#pragma pack(push, 1)
19
struct
HEARTSHARED_EXPORT
Header
{
23
unsigned
short
command
= 0;
//2 bytes
24
28
const
unsigned
char
headerVersion
= 1;
//3 bytes
29
33
unsigned
int
size
= 0;
//7 bytes
34
38
unsigned
int
hash
= 0;
//11 bytes
39
44
unsigned
int
triggerHash
= 0;
//15 bytes
45
49
unsigned
long
long
unusedSpace1
= 0;
//23 bytes
50
unsigned
long
long
unusedSpace2
= 0;
//31 bytes
51
unsigned
char
unusedSpace3
= 0;
//32 bytes
52
56
Header
();
57
~Header
() =
default
;
58
63
bool
isValid
()
const
;
64
68
void
reset
();
69
74
QString
toString
()
const
;
75
76
};
77
#pragma pack(pop)
78
}
79
80
81
82
#endif
// ABSTRACTHEADER_H
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
QH::Header::~Header
~Header()=default
QH::Header::unusedSpace3
unsigned char unusedSpace3
Definition
header.h:51
QH::Header::isValid
bool isValid() const
isValid This method check header size and compare commands.
Definition
header.cpp:18
QH::Header::headerVersion
const unsigned char headerVersion
headerVersion This is version of the header struct
Definition
header.h:28
QH::Header::hash
unsigned int hash
hash This is unique id of a package. id calc with CRC32 function for Qt implementation.
Definition
header.h:38
QH::Header::triggerHash
unsigned int triggerHash
triggerHash This is hash of request package that package has been responded. The server should write ...
Definition
header.h:44
QH::Header::toString
QString toString() const
toString This method return string of header of package.
Definition
header.cpp:36
QH::Header::size
unsigned int size
size This is size of package data (exclude header size).
Definition
header.h:33
QH::Header::reset
void reset()
reset This method reset all data and set for header invalid status.
Definition
header.cpp:25
QH::Header::command
unsigned short command
command of package for more information see the AbstractData::toPackage method.
Definition
header.h:23
QH::Header::unusedSpace1
unsigned long long unusedSpace1
unusedSpace This is unused space for changes of the header struct in the future.
Definition
header.h:49
QH::Header::Header
Header()
Header default constructor.
Definition
header.cpp:14
QH::Header::unusedSpace2
unsigned long long unusedSpace2
Definition
header.h:50
src
public
header.h
Generated by
1.18.0