diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-01 18:33:48 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-01 19:03:11 -0200 |
commit | 1e70badf548becec2a45b0b451e8a5cb322c0dc0 (patch) | |
tree | ac3cb586a419e1dbc7b36e23907545a637cd00c4 /libshiboken/autodecref.h | |
parent | 8edbbe2723eedc2c013dc1e23a18a4db3713da25 (diff) |
Use Shiboken::AutoDecRef to handle python references.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken/autodecref.h')
-rw-r--r-- | libshiboken/autodecref.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libshiboken/autodecref.h b/libshiboken/autodecref.h index c5c1e9605..9e8bc6619 100644 --- a/libshiboken/autodecref.h +++ b/libshiboken/autodecref.h @@ -57,9 +57,11 @@ public: Py_XDECREF(m_pyobj); } + bool isNull() const { return m_pyobj == 0; } /// Returns the pointer of the Python object being held. PyObject* object() { return m_pyobj; } operator PyObject*() { return m_pyobj; } + operator PyTupleObject*() { return reinterpret_cast<PyTupleObject*>(m_pyobj); } operator bool() const { return m_pyobj; } PyObject* operator->() { return m_pyobj; } private: |