Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhttp1configuration.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QHTTP1CONFIGURATION_H
6#define QHTTP1CONFIGURATION_H
7
8#include <QtNetwork/qtnetworkglobal.h>
9
10#include <QtCore/qtclasshelpermacros.h>
11#include <QtCore/qtypes.h>
12#include <QtCore/qtypeinfo.h>
13
14#include <utility>
15#include <cstdint>
16
18
19QT_BEGIN_NAMESPACE
20
21class QHttp1ConfigurationPrivate;
23{
24public:
28 : u{other.u} { other.u.d = nullptr; }
29
32
34
36 Q_NETWORK_EXPORT qsizetype numberOfConnectionsPerHost() const;
37
38 void swap(QHttp1Configuration &other) noexcept
39 { std::swap(u, other.u); }
40
41private:
42 struct ShortData {
43 std::uint8_t numConnectionsPerHost;
44 char reserved[sizeof(void*) - sizeof(numConnectionsPerHost)];
45 };
46 union U {
47 U(ShortData _data) : data(_data) {}
48 QHttp1ConfigurationPrivate *d;
49 ShortData data;
50 } u;
51
52 Q_NETWORK_EXPORT bool equals(const QHttp1Configuration &other) const noexcept;
53 Q_NETWORK_EXPORT size_t hash(size_t seed) const noexcept;
54
55 friend bool operator==(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
56 { return lhs.equals(rhs); }
57 friend bool operator!=(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
58 { return !lhs.equals(rhs); }
59
60 friend size_t qHash(const QHttp1Configuration &key, size_t seed = 0) noexcept { return key.hash(seed); }
61};
62
63Q_DECLARE_SHARED(QHttp1Configuration)
64
65QT_END_NAMESPACE
66
67#endif // QHTTP1CONFIGURATION_H
The QHttp1Configuration class controls HTTP/1 parameters and settings.
friend size_t qHash(const QHttp1Configuration &key, size_t seed=0) noexcept
void swap(QHttp1Configuration &other) noexcept
\memberswap{HTTP/1 configuration}
friend bool operator==(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
QHttp1Configuration(QHttp1Configuration &&other) noexcept
Move-constructs this QHttp1Configuration from other.
Q_NETWORK_EXPORT void setNumberOfConnectionsPerHost(qsizetype amount)
Sets the number of connections (minimum: 1; maximum: 255) used per http(s) {host}:{port}...
friend bool operator!=(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
QT_REQUIRE_CONFIG(http)