diff options
author | Renato Araujo Oliveira Filho <renato.filho@openbossa.org> | 2010-11-18 10:54:10 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:08:58 -0300 |
commit | 7e98252ba8e0d2fc72fc569b3ceb82662297ac9d (patch) | |
tree | 6d98c9c36b620f8abc4dbcbbdc1552f6c90b398d /libshiboken/basewrapper.h | |
parent | 31e6de8c9f237b1902be88baedf91ec9766bce87 (diff) |
Rewrite parent control functions.
Updated generator to new API.
Fix bug #462
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'libshiboken/basewrapper.h')
-rw-r--r-- | libshiboken/basewrapper.h | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h index 98b9a4e0a..f723a7a9b 100644 --- a/libshiboken/basewrapper.h +++ b/libshiboken/basewrapper.h @@ -114,26 +114,6 @@ namespace Shiboken LIBSHIBOKEN_API void initShiboken(); /** -* Set the parent of \p child to \p parent. -* When an object dies, all their children, granchildren, etc, are tagged as invalid. -* \param parent the parent object, if null, the child will have no parents. -* \param child the child. -*/ -LIBSHIBOKEN_API void setParent(PyObject* parent, PyObject* child); - -/** -* Remove this child from their parent, if any. -* \param child the child. -*/ -LIBSHIBOKEN_API void removeParent(SbkObject* child); - -/** -* \internal This is an internal function called by SbkBaseWrapper_Dealloc, it's exported just for techinical reasons. -* \note Do not call this function inside your bindings. -*/ -LIBSHIBOKEN_API void destroyParentInfo(SbkObject* obj, bool removeFromParent = true); - -/** * Returns true if the object is an instance of a type created by the Shiboken generator. */ inline bool isShibokenType(PyObject*& pyObj) @@ -215,9 +195,50 @@ LIBSHIBOKEN_API void* cppPointer(SbkObject* pyObj, PyTypeObject* desiredType); */ LIBSHIBOKEN_API bool setCppPointer(SbkObject* sbkObj, PyTypeObject* desiredType, void* cptr); -/// Returns false and sets a Python RuntimeError if the Python wrapper is not marked as valid. +/** + * Returns false and sets a Python RuntimeError if the Python wrapper is not marked as valid. + */ LIBSHIBOKEN_API bool isValid(PyObject* wrapper); +/** +* Set the parent of \p child to \p parent. +* When an object dies, all their children, granchildren, etc, are tagged as invalid. +* \param parent the parent object, if null, the child will have no parents. +* \param child the child. +*/ +LIBSHIBOKEN_API void setParent(PyObject* parent, PyObject* child); + +/** +* Remove this child from their parent, if any. +* \param child the child. +*/ +LIBSHIBOKEN_API void removeParent(SbkObject* child, bool giveOwnershipBack = true, bool keepReferenc = false); + +/** +* \internal This is an internal function called by SbkBaseWrapper_Dealloc, it's exported just for techinical reasons. +* \note Do not call this function inside your bindings. +*/ +LIBSHIBOKEN_API void destroyParentInfo(SbkObject* obj, bool removeFromParent = true); + +/** + * Mark the object as invalid + */ +LIBSHIBOKEN_API void invalidate(SbkObject* self); + +/** + * Help function can be used to invalida a sequence of object + **/ +LIBSHIBOKEN_API void invalidate(PyObject* pyobj); + +/** + * Make the object valid again + */ +LIBSHIBOKEN_API void makeValid(SbkObject* self); + +/** + * Destroy any data in Shiboken structure and c++ pointer if the pyboject has the ownership + **/ +LIBSHIBOKEN_API void destroy(SbkObject* self); } // namespace Wrapper |