Function Karana::Core::sharedPtrDiscard

Function Karana::Core::sharedPtrDiscard#

Function Documentation#

inline void Karana::Core::sharedPtrDiscard(ks_ptr<Base> &base)#

pybind11 utility used for discard method with shared pointers.

This will take care of a shared pointer discard. We:

  • Check the refcount to make sure this is the last reference.

  • Get the unique variable name that references the object in the local or global scope.

  • Perform the C++ discard with the holder that pybind11 currently has.

  • Delete the variable from the appropriate scope.

Parameters:

base – The Base* class that we want to discard.