aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/pointerholder.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-11-24 19:28:00 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-24 20:10:05 -0300
commita7ad5fdfc6cef168d538605ee0dec0e14f55f7d1 (patch)
tree82758e57c91efee1e447d716a004caeba5e7a923 /tests/libsample/pointerholder.h
parentb8db6d3d44eb4e7bdb1e680acb51b91dba64bbc6 (diff)
Added an PyObject* specialization to the Conversion template to
avoid problems when converting PyObjects to C++. Tests where also added for this. Reviewed by Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/libsample/pointerholder.h')
-rw-r--r--tests/libsample/pointerholder.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/libsample/pointerholder.h b/tests/libsample/pointerholder.h
new file mode 100644
index 000000000..7d4654511
--- /dev/null
+++ b/tests/libsample/pointerholder.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef POINTERHOLDER_H
+#define POINTERHOLDER_H
+
+#include "libsamplemacros.h"
+
+class LIBSAMPLE_API PointerHolder
+{
+public:
+ explicit PointerHolder(void* ptr) : m_pointer(ptr) {}
+ ~PointerHolder() {}
+ void* pointer() const { return m_pointer; }
+private:
+ void* m_pointer;
+};
+
+#endif // POINTERHOLDER_H
+