Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
ping.cpp
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
9
#include "
ping.h
"
10
11
#include <QDataStream>
12
namespace
QH
{
13
namespace
PKG
{
14
15
Ping::Ping
() {
16
17
}
18
19
Ping::Ping
(
const
Package
&from):
Ping
() {
20
fromBytes
(from.
data
);
21
}
22
23
bool
Ping::isValid
()
const
{
24
return
AbstractData::isValid
();
25
}
26
27
bool
Ping::ansver
()
const
{
28
return
_ansver;
29
}
30
31
void
Ping::setAnsver
(
bool
ansver
) {
32
_ansver =
ansver
;
33
}
34
35
QDataStream &
Ping::fromStream
(QDataStream &stream) {
36
37
stream >> _ansver;
38
return
stream;
39
40
}
41
42
QDataStream &
Ping::toStream
(QDataStream &stream)
const
{
43
stream << _ansver;
44
return
stream;
45
}
46
}
47
}
QH::PKG::AbstractData::isValid
bool isValid() const override
isValid This method check current object to valid.
Definition
abstractdata.cpp:40
QH::PKG::Ping::fromStream
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
Definition
ping.cpp:35
QH::PKG::Ping::toStream
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
Definition
ping.cpp:42
QH::PKG::Ping::setAnsver
void setAnsver(bool ansver)
setAnsver - Set the answer option.
Definition
ping.cpp:31
QH::PKG::Ping::isValid
bool isValid() const override
isValid - Check this package if valid.
Definition
ping.cpp:23
QH::PKG::Ping::Ping
Ping()
Definition
ping.cpp:15
QH::PKG::Ping::ansver
bool ansver() const
answer This is bool value for check this object that it is answer or request. Using on tests.
Definition
ping.cpp:27
QH::Package
The Package struct. This is base structure for transporting data by network between QH nodes....
Definition
package.h:23
QH::Package::data
QByteArray data
data This is source data of package.
Definition
package.h:33
QH::StreamBase::fromBytes
bool fromBytes(const QByteArray &dataz)
fromBytes This method provide initialization of object from byte array.
Definition
streambase.cpp:21
QH::PKG
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition
heart.h:211
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
ping.h
src
public
packages
ping.cpp
Generated by
1.18.0