sl@0: // Copyright David Abrahams 2002. sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: #ifndef REFCOUNT_DWA2002615_HPP sl@0: # define REFCOUNT_DWA2002615_HPP sl@0: sl@0: # include sl@0: # include sl@0: sl@0: namespace boost { namespace python { sl@0: sl@0: template sl@0: inline T* incref(T* p) sl@0: { sl@0: Py_INCREF(python::upcast(p)); sl@0: return p; sl@0: } sl@0: sl@0: template sl@0: inline T* xincref(T* p) sl@0: { sl@0: Py_XINCREF(python::upcast(p)); sl@0: return p; sl@0: } sl@0: sl@0: template sl@0: inline void decref(T* p) sl@0: { sl@0: Py_DECREF(python::upcast(p)); sl@0: } sl@0: sl@0: template sl@0: inline void xdecref(T* p) sl@0: { sl@0: Py_XDECREF(python::upcast(p)); sl@0: } sl@0: sl@0: }} // namespace boost::python sl@0: sl@0: #endif // REFCOUNT_DWA2002615_HPP