Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QHTTP1CONFIGURATION_H
5#define QHTTP1CONFIGURATION_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8
9#include <utility>
10#include <cstdint>
11
13
15
16class QHttp1ConfigurationPrivate;
18{
19public:
20 Q_NETWORK_EXPORT QHttp1Configuration();
23 : u{other.u} { other.u.d = nullptr; }
24
26 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QHttp1Configuration)
27
28 Q_NETWORK_EXPORT ~QHttp1Configuration();
29
30 Q_NETWORK_EXPORT void setNumberOfConnectionsPerHost(qsizetype amount);
31 Q_NETWORK_EXPORT qsizetype numberOfConnectionsPerHost() const;
32
34 { std::swap(u, other.u); }
35
36private:
37 struct ShortData {
38 std::uint8_t numConnectionsPerHost;
39 char reserved[sizeof(void*) - sizeof(numConnectionsPerHost)];
40 };
41 union U {
42 U(ShortData _data) : data(_data) {}
43 QHttp1ConfigurationPrivate *d;
45 } u;
46
47 Q_NETWORK_EXPORT bool equals(const QHttp1Configuration &other) const noexcept;
48 Q_NETWORK_EXPORT size_t hash(size_t seed) const noexcept;
49
50 friend bool operator==(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
51 { return lhs.equals(rhs); }
52 friend bool operator!=(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
53 { return !lhs.equals(rhs); }
54
55 friend size_t qHash(const QHttp1Configuration &key, size_t seed = 0) noexcept { return key.hash(seed); }
56};
57
58Q_DECLARE_SHARED(QHttp1Configuration)
59
61
62#endif // QHTTP1CONFIGURATION_H
The QHttp1Configuration class controls HTTP/1 parameters and settings.
Q_NETWORK_EXPORT QHttp1Configuration(const QHttp1Configuration &other)
Copy-constructs this QHttp1Configuration.
Q_NETWORK_EXPORT QHttp1Configuration()
Default constructs a QHttp1Configuration object.
friend bool operator==(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
void swap(QHttp1Configuration &other) noexcept
Swaps this HTTP/1 configuration with other.
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} combination ...
friend bool operator!=(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs) noexcept
friend size_t qHash(const QHttp1Configuration &key, size_t seed=0) noexcept
Q_NETWORK_EXPORT QHttp1Configuration & operator=(const QHttp1Configuration &other)
Copy-assigns other to this QHttp1Configuration.
Q_NETWORK_EXPORT qsizetype numberOfConnectionsPerHost() const
Returns the number of connections used per http(s) {host}:{port} combination.
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
QDateTimePrivate::QDateTimeShortData ShortData
GLuint64 key
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define QT_REQUIRE_CONFIG(feature)
ptrdiff_t qsizetype
Definition qtypes.h:165
QSharedPointer< T > other(t)
[5]