• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[section boost/python/opaque_pointer_converter.hpp]
2[section Introduction]
3`opaque<>` registers itself as a converter from Python objects to pointers to undefined types and vice versa.
4``
5namespace boost { namespace python
6{
7    template<class Pointee>
8    struct opaque
9    {
10        opaque();
11    };
12}}
13``
14[endsect]
15[section Class template `opaque` constructor]
16``opaque();``
17[variablelist
18[[Effects][
19* Registers the instance as a [link to_from_python_type_conversion.boost_python_lvalue_from_pytype_.class_template_lvalue_from_pytyp `lvalue_from_pytype`] converter from Python objects into opaque pointers.
20  The Python Objects created are named after the type pointed to by the opaque pointer being wrapped.
21* Registers the instance as a [link to_from_python_type_conversion.boost_python_to_python_converter.class_template_to_python_convert `to_python_converter`] from opaque pointers to Python objects.
22]]
23]
24[note If there is already an instance registered by another module, this instance doesn't try to register again in order to avoid warnings about multiple registrations.]
25
26[endsect]
27[section Macro `BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee)`]
28This macro must be used to define specializations of the [link utility_and_infrastructure.boost_python_type_id_hpp.functions `type_id`] function which can't be instantiated for incomplete types.
29[note The macro must be invoked in every translation unit which uses the opaque converter.]
30[endsect]
31[endsect]
32