aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/onlycopy.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/onlycopy.h')
-rw-r--r--sources/shiboken6/tests/libsample/onlycopy.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/onlycopy.h b/sources/shiboken6/tests/libsample/onlycopy.h
new file mode 100644
index 000000000..7dc3e0069
--- /dev/null
+++ b/sources/shiboken6/tests/libsample/onlycopy.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef ONLYCOPYCLASS_H
+#define ONLYCOPYCLASS_H
+
+#include "libsamplemacros.h"
+
+#include <list>
+#include <memory>
+
+// These classes simulate a situation found in QWebEngineHistoryItem.
+
+class OnlyCopyPrivate;
+
+class LIBSAMPLE_API OnlyCopy
+{
+public:
+ LIBMINIMAL_DEFAULT_COPY_MOVE(OnlyCopy)
+
+ ~OnlyCopy();
+
+ int value() const;
+ static int getValue(OnlyCopy onlyCopy) { return onlyCopy.value(); }
+ static int getValueFromReference(const OnlyCopy &onlyCopy) { return onlyCopy.value(); }
+
+private:
+ friend class FriendOfOnlyCopy;
+
+ explicit OnlyCopy(int value);
+
+ std::shared_ptr<OnlyCopyPrivate> d;
+};
+
+class LIBSAMPLE_API FriendOfOnlyCopy
+{
+public:
+ static OnlyCopy createOnlyCopy(int value);
+ static std::list<OnlyCopy> createListOfOnlyCopy(int quantity);
+};
+
+#endif // ONLYCOPYCLASS_H