aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/blackbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libsample/blackbox.h')
-rw-r--r--sources/shiboken6/tests/libsample/blackbox.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/blackbox.h b/sources/shiboken6/tests/libsample/blackbox.h
new file mode 100644
index 000000000..9d32670dd
--- /dev/null
+++ b/sources/shiboken6/tests/libsample/blackbox.h
@@ -0,0 +1,44 @@
+// 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 BLACKBOX_H
+#define BLACKBOX_H
+
+#include "libsamplemacros.h"
+#include "objecttype.h"
+#include "point.h"
+
+#include <list>
+#include <map>
+
+class LIBSAMPLE_API BlackBox
+{
+public:
+ using ObjectTypeMap = std::map<int, ObjectType*>;
+ using PointMap = std::map<int, Point*>;
+
+ LIBMINIMAL_DEFAULT_COPY_MOVE(BlackBox)
+ BlackBox() noexcept = default;
+ ~BlackBox();
+
+ int keepObjectType(ObjectType *object);
+ ObjectType *retrieveObjectType(int ticket);
+ void disposeObjectType(int ticket);
+
+ int keepPoint(Point *point);
+ Point *retrievePoint(int ticket);
+ void disposePoint(int ticket);
+
+ std::list<ObjectType*> objects();
+ std::list<Point*> points();
+
+ inline void referenceToValuePointer(Point*&) {}
+ inline void referenceToObjectPointer(ObjectType*&) {}
+
+private:
+ ObjectTypeMap m_objects;
+ PointMap m_points;
+ int m_ticket = -1;
+};
+
+#endif // BLACKBOX_H