1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/refcount.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,41 @@
1.4 +// Copyright David Abrahams 2002.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef REFCOUNT_DWA2002615_HPP
1.9 +# define REFCOUNT_DWA2002615_HPP
1.10 +
1.11 +# include <boost/python/detail/prefix.hpp>
1.12 +# include <boost/python/cast.hpp>
1.13 +
1.14 +namespace boost { namespace python {
1.15 +
1.16 +template <class T>
1.17 +inline T* incref(T* p)
1.18 +{
1.19 + Py_INCREF(python::upcast<PyObject>(p));
1.20 + return p;
1.21 +}
1.22 +
1.23 +template <class T>
1.24 +inline T* xincref(T* p)
1.25 +{
1.26 + Py_XINCREF(python::upcast<PyObject>(p));
1.27 + return p;
1.28 +}
1.29 +
1.30 +template <class T>
1.31 +inline void decref(T* p)
1.32 +{
1.33 + Py_DECREF(python::upcast<PyObject>(p));
1.34 +}
1.35 +
1.36 +template <class T>
1.37 +inline void xdecref(T* p)
1.38 +{
1.39 + Py_XDECREF(python::upcast<PyObject>(p));
1.40 +}
1.41 +
1.42 +}} // namespace boost::python
1.43 +
1.44 +#endif // REFCOUNT_DWA2002615_HPP