Shiboken::BindingManager Class

class Shiboken::BindingManager

Maintains a set of wrappers. More...

Header: #include <bindingmanager.h>

Public Functions

BindingManager(const Shiboken::BindingManager &)
BindingManager(Shiboken::BindingManager &&)
Shiboken::BindingManager::TypeCptrPair findDerivedType(void *cptr, PyTypeObject *type) const
PyTypeObject *resolveType(void **cptr, PyTypeObject *type)
void unregisterWrapper(SbkObject *sbkObj)
void visitAllPyObjects(Shiboken::ObjectVisitor visitor, void *data)
Shiboken::BindingManager &operator=(Shiboken::BindingManager &&)
Shiboken::BindingManager &operator=(const Shiboken::BindingManager &)

Static Public Members

void *runTypeDiscovery(void *cptr, PyTypeObject *probeType, PyTypeObject *type)

Detailed Description

Member Function Documentation

[delete] BindingManager::BindingManager(const Shiboken::BindingManager &)

Copy-constructs an instance of BindingManager. This function is deleted.

[delete] BindingManager::BindingManager(Shiboken::BindingManager &&)

Move-constructs an instance of BindingManager. This function is deleted.

Shiboken::BindingManager::TypeCptrPair BindingManager::findDerivedType(void *cptr, PyTypeObject *type) const

Tries to find the correct type of cptr via type discovery knowing that it is at least of type type. If a derived class is found, it returns the type and cptr cast to the type (which may be different in case of multiple inheritance).

PyTypeObject *BindingManager::resolveType(void **cptr, PyTypeObject *type)

Tries to find the correct type of *cptr knowing that it is at least of type type.

cptr is a pointer to a pointer to the instance of type type. In case of multiple inheritance, this function may change the contents of cptr.

Warning: This function is slow, use it only as last resort.

[static] void *BindingManager::runTypeDiscovery(void *cptr, PyTypeObject *probeType, PyTypeObject *type)

If probeType has a type discovery function, runs it passing cptr (a pointer to the instance of type type) and type and returns the (cast) pointer or nullptr.

void BindingManager::unregisterWrapper(SbkObject *sbkObj)

Takes the object sbkObj out of the wrapper map, leaving its flags alone. Deallocation uses this to make the wrapper unreachable before it runs any Python code; releaseWrapper() is the same plus invalidation.

void BindingManager::visitAllPyObjects(Shiboken::ObjectVisitor visitor, void *data)

Calls the function visitor for each object registered on binding manager, passing data (user data) as second argument.

Note: As various C++ pointers can point to the same PyObject due to multiple inheritance, the visitor can be called more than once for each PyObject.

[delete] Shiboken::BindingManager &BindingManager::operator=(Shiboken::BindingManager &&)

Move-assigns other to this BindingManager instance. This function is deleted.

[delete] Shiboken::BindingManager &BindingManager::operator=(const Shiboken::BindingManager &)

Copy-assigns other to this BindingManager instance. This function is deleted.