crossmod_opaque_b.cpp 709 B

1234567891011121314151617181920212223242526
  1. // Copyright Gottfried Ganßauge 2006.
  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. # include <boost/python/return_opaque_pointer.hpp>
  6. # include <boost/python/def.hpp>
  7. # include <boost/python/module.hpp>
  8. # include <boost/python/return_value_policy.hpp>
  9. typedef struct opaque_ *opaque;
  10. opaque the_op = ((opaque) 0x47110815);
  11. opaque get() { return the_op; }
  12. BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_)
  13. namespace bpl = boost::python;
  14. BOOST_PYTHON_MODULE(crossmod_opaque_b)
  15. {
  16. bpl::def (
  17. "get",
  18. &::get,
  19. bpl::return_value_policy<bpl::return_opaque_pointer>());
  20. }