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;
43 typeAndFlags.type =
type;
49 typeAndFlags.type =
type;
52 QNativeIpcKey(
const QNativeIpcKey &
other)
59 QNativeIpcKey(QNativeIpcKey &&
other) noexcept
63 move_internal(std::move(
other));
72 QNativeIpcKey &operator=(
const QNativeIpcKey &
other)
75 if (isSlowPath() ||
other.isSlowPath())
76 return assign_internal(
other);
81 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QNativeIpcKey)
101 return type_internal();
102 return typeAndFlags.type;
108 return setType_internal(
type);
109 typeAndFlags.type =
type;
112 QString nativeKey() const noexcept
114 void setNativeKey(
const QString &newKey)
118 setNativeKey_internal(newKey);
125 struct TypeAndFlags {
126#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
134#if Q_BYTE_ORDER == Q_BIG_ENDIAN
145 TypeAndFlags typeAndFlags;
146 static_assert(
sizeof(typeAndFlags) ==
sizeof(
d));
151 friend class QNativeIpcKeyPrivate;
152 QNativeIpcKeyPrivate *d_func();
153 const QNativeIpcKeyPrivate *d_func()
const;
154 constexpr bool isSlowPath() const noexcept
155 {
return Q_UNLIKELY(typeAndFlags.isExtended); }
157 friend bool operator==(
const QNativeIpcKey &lhs,
const QNativeIpcKey &rhs)
noexcept
159 if (lhs.key != rhs.key)
163 if (lhs.isSlowPath() && rhs.isSlowPath())
164 return compare_internal(lhs, rhs) == 0;
165 return lhs.d == rhs.d;
167 friend bool operator!=(
const QNativeIpcKey &lhs,
const QNativeIpcKey &rhs)
noexcept
169 return !(lhs == rhs);
172 Q_CORE_EXPORT
void copy_internal(
const QNativeIpcKey &
other);
173 Q_CORE_EXPORT
void move_internal(QNativeIpcKey &&
other)
noexcept;
174 Q_CORE_EXPORT QNativeIpcKey &assign_internal(
const QNativeIpcKey &
other);
175 Q_CORE_EXPORT
void destroy_internal() noexcept;
177 Q_CORE_EXPORT
void setType_internal(
Type);
178 Q_CORE_EXPORT
void setNativeKey_internal(const
QString &);
180 compare_internal(const QNativeIpcKey &lhs, const QNativeIpcKey &rhs) noexcept;
188Q_DECLARE_SHARED(QNativeIpcKey)
190inline auto QNativeIpcKey::legacyDefaultTypeForOs() noexcept ->
Type
193 return Type::Windows;
194#elif defined(QT_POSIX_IPC)
195 return Type::PosixRealtime;
196#elif defined(Q_OS_DARWIN)
197 return defaultTypeForOs_internal();
199 return Type::SystemV;
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_CONST_FUNCTION
constexpr bool operator!=(const timespec &t1, const timespec &t2)
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
proxy setType(QNetworkProxy::Socks5Proxy)
char * toString(const MyType &t)
[31]