aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsmart/smart_obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsmart/smart_obj.h')
-rw-r--r--sources/shiboken6/tests/libsmart/smart_obj.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsmart/smart_obj.h b/sources/shiboken6/tests/libsmart/smart_obj.h
new file mode 100644
index 000000000..9f4f8425d
--- /dev/null
+++ b/sources/shiboken6/tests/libsmart/smart_obj.h
@@ -0,0 +1,45 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef SMART_OBJ_H
+#define SMART_OBJ_H
+
+#include "libsmartmacros.h"
+#include "smart_sharedptr.h"
+
+#include <vector>
+
+class Integer;
+class Obj;
+namespace Smart { class Integer2; }
+
+// Couldn't name it Object because it caused some namespace clashes.
+class LIB_SMART_API Obj {
+public:
+ Obj();
+ Obj(const Obj &other) = delete;
+ Obj &operator=(const Obj &other) = delete;
+ Obj(Obj &&other) = delete;
+ Obj &operator=(Obj &&other) = delete;
+ virtual ~Obj();
+
+ void printObj();
+ Integer takeInteger(Integer val);
+ static SharedPtr<Obj> createSharedPtrObj();
+ std::vector<SharedPtr<Obj> > createSharedPtrObjList(int size);
+ virtual SharedPtr<Integer> createSharedPtrInteger(); // virtual for PYSIDE-1188
+ SharedPtr<const Integer> createSharedPtrConstInteger();
+ int takeSharedPtrToConstInteger(SharedPtr<const Integer> pInt);
+ SharedPtr<Smart::Integer2> createSharedPtrInteger2();
+ int takeSharedPtrToObj(SharedPtr<Obj> pObj);
+ int takeSharedPtrToInteger(SharedPtr<Integer> pInt);
+ int takeSharedPtrToIntegerByConstRef(const SharedPtr<Integer> &pInt);
+
+ static SharedPtr<Integer> createSharedPtrInteger(int value);
+ static SharedPtr<Integer> createNullSharedPtrInteger();
+
+ int m_integer; // public for testing member field access.
+ Integer *m_internalInteger;
+};
+
+#endif // SMART_OBJ_H