Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
apiversion.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2020-2024 QuasarApp.
3//# Distributed under the GPLv3 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 APPVERSION_H
9#define APPVERSION_H
10
11#include "distversion.h"
12#include <abstractdata.h>
13
14
15namespace QH {
16
17namespace PKG {
18
19
24{
25
26public:
27 APIVersion();
28
29 static unsigned short command(){return PROTOCKOL_VERSION_COMMAND;}
30 static unsigned short version(){return 0;}
31
32 static QString commandText(){return "PROTOCKOL_VERSION_COMMAND";}
33 unsigned short cmd() const override {return APIVersion::command();}
34
35 QString cmdString() const override {return APIVersion::commandText();}
36
37 bool isValid() const override;
38
44 void setPackagesVersions(const PackagesVersionData &newPackagesVersions);
45
47 void setApisVersions(const VersionData &newApisVersions);
48
49protected:
50 QDataStream &fromStream(QDataStream &stream) override;
51 QDataStream &toStream(QDataStream &stream) const override;
52
53private:
54 VersionData _apisVersions;
55 PackagesVersionData _packagesVersions;
56
57};
58
59}
60}
61#endif // APPVERSION_H
#define PROTOCKOL_VERSION_COMMAND
PROTOCKOL_VERSION_COMMAND is command for exchange versions number betwin nodes.
The APIVersion class This is base pacakge class that send information about supported api version on ...
Definition apiversion.h:24
static QString commandText()
Definition apiversion.h:32
void setPackagesVersions(const PackagesVersionData &newPackagesVersions)
static unsigned short command()
Definition apiversion.h:29
void setApisVersions(const VersionData &newApisVersions)
bool isValid() const override
isValid This method check current object to valid.
VersionData apisVersions() const
QDataStream & fromStream(QDataStream &stream) override
fromStream This method should be read all bytes from the stream object and full the current object.
unsigned short cmd() const override
cmd - This is command of this object, (for generate cmd use macross QH_PACKAGE)
Definition apiversion.h:33
QString cmdString() const override
cmdString - This is command string of this object, (for generate cmd use macross QH_PACKAGE)
Definition apiversion.h:35
static unsigned short version()
Definition apiversion.h:30
PackagesVersionData packagesVersions() const
packagesVersions This method return list of available multi-version packages on the node.
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
The AbstractData class is provide base functions for transport data by network For create you own pac...
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
QHash< QString, DistVersion > VersionData
VersionData This is array of all available apis and supported its versions.
Definition distversion.h:73
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.
Definition distversion.h:78