raw_pyobject.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef RAW_PYOBJECT_DWA2002628_HPP
  6. # define RAW_PYOBJECT_DWA2002628_HPP
  7. namespace boost { namespace python { namespace detail {
  8. //
  9. // Define some types which we can use to get around the vagaries of
  10. // PyObject*. We will use these to initialize object instances, and
  11. // keep them in namespace detail to make sure they stay out of the
  12. // hands of users. That is much simpler than trying to grant
  13. // friendship to all the appropriate parties.
  14. //
  15. // New references are normally checked for null
  16. struct new_reference_t;
  17. typedef new_reference_t* new_reference;
  18. // Borrowed references are assumed to be non-null
  19. struct borrowed_reference_t;
  20. typedef borrowed_reference_t* borrowed_reference;
  21. // New references which aren't checked for null
  22. struct new_non_null_reference_t;
  23. typedef new_non_null_reference_t* new_non_null_reference;
  24. }}} // namespace boost::python::detail
  25. #endif // RAW_PYOBJECT_DWA2002628_HPP