Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
distversion.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 DISTVERSION_H
9#define DISTVERSION_H
10
11#include "humanreadableobject.h"
12#include <QHash>
13#include <streambase.h>
14
15
16namespace QH {
17
21class HEARTSHARED_EXPORT DistVersion: public StreamBase, public QuasarAppUtils::iHRO {
22
23public:
24
25 operator bool() const;
26
27 unsigned short min() const;
28 void setMin(unsigned short newMin);
29 unsigned short max() const;
30 void setMax(unsigned short newMax);
31
37 int getMaxCompatible(const DistVersion& distVersion) const;
38
44 int getMinCompatible(const DistVersion& distVersion) const;
45
51 bool isSupport(unsigned short version) const;
52
53 QString toString() const override;
54
55 // ValidableObject interface
56 bool isValid() const override;
57
58protected:
59
60 QDataStream &fromStream(QDataStream &stream) override;
61 QDataStream &toStream(QDataStream &stream) const override;
62
63private:
64
66 unsigned short _min = 0;
67
69 unsigned short _max = 0;
70
71
72
73};
74
78typedef QHash<QString, DistVersion> VersionData;
79
83typedef QHash<unsigned short, DistVersion> PackagesVersionData;
84
85}
86#endif // DISTVERSION_H
The DistVersion class This is information of supported versions of the destinations api.
Definition distversion.h:21
int getMinCompatible(const DistVersion &distVersion) const
getMinСompatible return maximum available on booth nodes version.
void setMax(unsigned short newMax)
bool isSupport(unsigned short version) const
isSupport This method return true if the version is supported of this versions range.
void setMin(unsigned short newMin)
QDataStream & toStream(QDataStream &stream) const override
fromStream This method should be write all members of the current object to the stream object.
bool isValid() const override
unsigned short min() const
unsigned short max() const
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
int getMaxCompatible(const DistVersion &distVersion) const
getMaxСompatible return maximum available on booth nodes version.
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:78
QHash< unsigned short, DistVersion > PackagesVersionData
PackagesVersionData This is some as VersionData but for int commands.
Definition distversion.h:83