Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
multiversiondata.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023-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#ifndef MULTIVERSIONDATA_H
9#define MULTIVERSIONDATA_H
10
11#include "abstractdata.h"
12
13
14namespace QH {
15namespace PKG {
16
18 std::function<QDataStream& (QDataStream& stream)> from = nullptr;
19 std::function<QDataStream& (QDataStream& stream)> to = nullptr;
20};
21
68{
69public:
74 MultiversionData(const QMap<unsigned short /*version*/, SerializationBox>& serializers);
75
80 const DistVersion& packageVersion() const;
81
82 QDataStream& fromStream(QDataStream& stream) override final;
83 QDataStream& toStream(QDataStream& stream) const override final;
84
91 QByteArray toBytesOf(const DistVersion &version) const;
92
99 QDataStream& toStreamOf(QDataStream& stream, const DistVersion &version) const;
100
101
102 bool toPackage(Package &package, const DistVersion &reqVersion, unsigned int triggerHash = 0) const override final;
103
104
105private:
106 DistVersion _packageVersion;
107 QMap<unsigned short /*version*/, SerializationBox> _serializers;
108
109
110};
111}
112}
113#endif // MULTIVERSIONDATA_H
The DistVersion class This is information of supported versions of the destinations api.
Definition distversion.h:21
The AbstractData class is provide base functions for transport data by network For create you own pac...
The MultiversionData class This class add support for multiple versions of ne command/package....
The Package struct. This is base structure for transporting data by network between QH nodes....
Definition package.h:23
#define HEARTSHARED_EXPORT
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
std::function< QDataStream &(QDataStream &stream)> to
std::function< QDataStream &(QDataStream &stream)> from