Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
bigdataheader.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-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#include "bigdataheader.h"
9
10namespace QH {
11namespace PKG {
12
16
18 return BigDataBase::isValid() && packagesCount >= 2 && _command;
19}
20
21QString BigDataHeader::toString() const {
22 return BigDataBase::toString() +
23 " Packages count: " +
24 QString::number(packagesCount) +
25 " Packages command: " +
26 QString::number(_command);
27}
28
30 return packagesCount;
31}
32
33void BigDataHeader::setPackagesCount(int newPackagesCount) {
34 packagesCount = newPackagesCount;
35}
36
37QDataStream &BigDataHeader::fromStream(QDataStream &stream) {
39
40 stream >> packagesCount;
41 stream >> _command;
42
43 return stream;
44}
45
46QDataStream &BigDataHeader::toStream(QDataStream &stream) const {
48
49 stream << packagesCount;
50 stream << _command;
51
52 return stream;
53}
54
55unsigned short BigDataHeader::getCommand() const {
56 return _command;
57}
58
59void BigDataHeader::setCommand(unsigned short newCommand) {
60 _command = newCommand;
61}
62
63}
64}
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
QString toString() const override
bool isValid() const override
isValid This method check current object to valid.
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
QString toString() const override
unsigned short getCommand() const
getCommand This method return commnad of moving package.
int getPackagesCount() const
getPackagesCount This method return count of parts of bigdata package.
void setCommand(unsigned short newCommand)
setCommand This method sets new value for package command that will moved
bool isValid() const override
isValid This method check current object to valid.
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
void setPackagesCount(int newPackagesCount)
setPackagesCount This method sets new count of pcakges.
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13