###  | # Boost.Python ## Header <boost/python/opaque_pointer_converter.hpp>

## Contents

Classes
  Class template `opaque_pointer_converter<P>`
    Class template `opaque_pointer_converter` synopsis
Macros
  Macro `BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID`
Example
See Also

## Classes

### Class template `opaque_pointer_converter<P>`

`opaque_pointer_converter<>` is derived from `to_python_converter` and registers itself as an `lvalue_from_pytype` converter from Python objects into pointers to undefined types. Thus it may be used as a converter from opaque pointers into Python objects and vice versa.

#### Class template `opaque_pointer_converter` synopsis

    namespace boost { namespace python
    {
        template<class Pointer>
        struct opaque_pointer_converter
            : to_python_converter<
              Pointer, opaque_pointer_converter<Pointer> >
        {
            explicit opaque_pointer_converter(char const* name);
        };
    }}

#### Class template `opaque_pointer_converter` constructor

    explicit opaque_pointer_converter(char const* name);

Effects:

Registers the instance as a `lvalue_from_pytype` converter from Python objects into opaque pointers.

The name is used for the type of the Python Objects created; it should be printable but needn't be an ntbs because the object type is not supposed to be user constructible within python scripts.

## Macros

### Macro BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee)

This macro must be used to define specializations of the type_id function which can't be instantiated for incomplete types.

#### Note

In order for this to work in a cross-module environment the macro must be invoked in every translation unit which uses the opaque_pointer_converter.

## Example

please see example for return_opaque_pointer.

## See Also

return_opaque_pointer

Revised 10 March, 2003

© Copyright 2003 Haufe Mediengruppe. All Rights Reserved.