7#include <QtCore/qglobal.h>
8#include <QtCore/qtcore-config.h>
10#if QT_CONFIG(sharedmemory) || QT_CONFIG(systemsemaphore)
11# include <QtCore/qstring.h>
12# include <QtCore/qobjectdefs.h>
16class QNativeIpcKeyPrivate;
26 PosixRealtime = 0x100,
31 static constexpr Type DefaultTypeForOs =
38 static Type legacyDefaultTypeForOs() noexcept;
40 constexpr QNativeIpcKey() noexcept = default;
52 QNativeIpcKey(
const QNativeIpcKey &
other)
59 QNativeIpcKey(QNativeIpcKey &&
other) noexcept
61 typeAndFlags(std::move(
other.typeAndFlags))
64 move_internal(std::move(
other));
73 QNativeIpcKey &operator=(
const QNativeIpcKey &
other)
75 typeAndFlags =
other.typeAndFlags;
77 if (isSlowPath() ||
other.isSlowPath())
78 return assign_internal(
other);
83 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QNativeIpcKey)
88 typeAndFlags.swap(
other.typeAndFlags);
91 bool isEmpty() const noexcept
96 bool isValid() const noexcept
101 constexpr Type type() const noexcept
103 return typeAndFlags.type;
109 return setType_internal(
type);
110 typeAndFlags.type =
type;
113 QString nativeKey() const noexcept
117 void setNativeKey(
const QString &newKey)
121 setNativeKey_internal(newKey);
128 struct TypeAndFlags {
136 std::swap(reserved1,
other.reserved1);
137 std::swap(reserved2,
other.reserved2);
140 friend constexpr bool operator==(
const TypeAndFlags &lhs,
const TypeAndFlags &rhs)
noexcept
142 return lhs.type == rhs.type &&
143 lhs.reserved1 == rhs.reserved1 &&
144 lhs.reserved2 == rhs.reserved2;
148 QNativeIpcKeyPrivate *
d =
nullptr;
150 TypeAndFlags typeAndFlags;
152 friend class QNativeIpcKeyPrivate;
153 constexpr bool isSlowPath() const noexcept
156 friend Q_CORE_EXPORT
size_t qHash(
const QNativeIpcKey &ipcKey,
size_t seed)
noexcept;
157 friend size_t qHash(
const QNativeIpcKey &ipcKey)
noexcept
158 {
return qHash(ipcKey, 0); }
160 Q_CORE_EXPORT
void copy_internal(
const QNativeIpcKey &
other);
161 Q_CORE_EXPORT
void move_internal(QNativeIpcKey &&
other)
noexcept;
162 Q_CORE_EXPORT QNativeIpcKey &assign_internal(
const QNativeIpcKey &
other);
163 Q_CORE_EXPORT
void destroy_internal() noexcept;
164 Q_CORE_EXPORT
void setType_internal(
Type);
165 Q_CORE_EXPORT
void setNativeKey_internal(const
QString &);
167 compare_internal(const QNativeIpcKey &lhs, const QNativeIpcKey &rhs) noexcept;
172 friend bool comparesEqual(
const QNativeIpcKey &lhs,
const QNativeIpcKey &rhs)
noexcept
174 if (!(lhs.typeAndFlags == rhs.typeAndFlags))
176 if (lhs.key != rhs.key)
180 return compare_internal(lhs, rhs) == 0;
186Q_DECLARE_SHARED(QNativeIpcKey)
188inline auto QNativeIpcKey::legacyDefaultTypeForOs() noexcept ->
Type
191 return Type::Windows;
192#elif defined(QT_POSIX_IPC)
193 return Type::PosixRealtime;
194#elif defined(Q_OS_DARWIN)
195 return defaultTypeForOs_internal();
197 return Type::SystemV;
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_CONST_FUNCTION
bool comparesEqual(const QDir &lhs, const QDir &rhs)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
proxy setType(QNetworkProxy::Socks5Proxy)
char * toString(const MyType &t)
[31]