File: opaque_pointer_converter.qbk

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (31 lines) | stat: -rw-r--r-- 1,469 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[section boost/python/opaque_pointer_converter.hpp]
[section Introduction]
`opaque<>` registers itself as a converter from Python objects to pointers to undefined types and vice versa.
``
namespace boost { namespace python
{
    template<class Pointee>
    struct opaque
    {
        opaque();
    };
}}
``
[endsect]
[section Class template `opaque` constructor]
``opaque();``
[variablelist
[[Effects][
* 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.
  The Python Objects created are named after the type pointed to by the opaque pointer being wrapped.
* 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.
]]
]
[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.]

[endsect]
[section Macro `BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee)`]
This 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.
[note The macro must be invoked in every translation unit which uses the opaque converter.]
[endsect]
[endsect]