Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
ping.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
9#ifndef PING_H
10#define PING_H
11
12#include "abstractdata.h"
13
14
15namespace QH {
16namespace PKG {
17
21class HEARTSHARED_EXPORT Ping: public AbstractData
22{
23 QH_PACKAGE("Ping")
24
25public:
26 Ping();
27 Ping(const Package& from);
28
29 // AbstractData interface
34 bool isValid() const override;
35
41 bool ansver() const;
42
43/* I thing you need to correct the name of this method. From "setAnsver" to "setAnswer" */
44
49 void setAnsver(bool ansver);
50
51protected:
52 // StreamBase interface
53 QDataStream &fromStream(QDataStream &stream) override;
54 QDataStream &toStream(QDataStream &stream) const override;
55
56private:
57 bool _ansver = false;
58};
59}
60}
61#endif // PING_H
62
63
64
#define QH_PACKAGE(S)
QH_PACKAGE This macross prepare data to send and create a global id for package. For get global id us...
AbstractData()
AbstractData - Base constructor of this object.
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
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
void setAnsver(bool ansver)
setAnsver - Set the answer option.
Definition ping.cpp:31
bool isValid() const override
isValid - Check this package if valid.
Definition ping.cpp:23
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
The Package struct. This is base structure for transporting data by network between QH nodes....
Definition package.h:23
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition heart.h:211
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13