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
qsharedmemory.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QSHAREDMEMORY_H
6#define QSHAREDMEMORY_H
7
8#include <QtCore/qtipccommon.h>
9#ifndef QT_NO_QOBJECT
10# include <QtCore/qobject.h>
11#else
12# include <QtCore/qobjectdefs.h>
13# include <QtCore/qscopedpointer.h>
14# include <QtCore/qstring.h>
15#endif
16
18
19#if QT_CONFIG(sharedmemory)
20
22
24{
27
28public:
29 enum AccessMode
30 {
33 };
35
37 {
38 NoError,
47 };
49
50 QSharedMemory(QObject *parent = nullptr);
51 QSharedMemory(const QNativeIpcKey &key, QObject *parent = nullptr);
53
54 QSharedMemory(const QString &key, QObject *parent = nullptr);
55 void setKey(const QString &key);
56 QString key() const;
57
58 void setNativeKey(const QNativeIpcKey &key);
60 { setNativeKey({ key, type }); }
61 QString nativeKey() const;
63#if QT_CORE_REMOVED_SINCE(6, 5)
64 void setNativeKey(const QString &key);
65#endif
66
68 qsizetype size() const;
69
71 bool isAttached() const;
72 bool detach();
73
74 void *data();
75 const void* constData() const;
76 const void *data() const;
77
78#if QT_CONFIG(systemsemaphore)
79 bool lock();
80 bool unlock();
81#endif
82
84 QString errorString() const;
85
91
92private:
94};
95
96#endif // QT_CONFIG(sharedmemory)
97
99
100#endif // QSHAREDMEMORY_H
\inmodule QtSql