os/ossrv/ossrv_pub/boost_apis/boost/python/converter/registry.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
//  Copyright David Abrahams 2001.
sl@0
     2
// Distributed under the Boost Software License, Version 1.0. (See
sl@0
     3
// accompanying file LICENSE_1_0.txt or copy at
sl@0
     4
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
     5
#ifndef REGISTRY_DWA20011127_HPP
sl@0
     6
# define REGISTRY_DWA20011127_HPP
sl@0
     7
# include <boost/python/type_id.hpp>
sl@0
     8
# include <boost/python/converter/to_python_function_type.hpp>
sl@0
     9
# include <boost/python/converter/rvalue_from_python_data.hpp>
sl@0
    10
# include <boost/python/converter/constructor_function.hpp>
sl@0
    11
# include <boost/python/converter/convertible_function.hpp>
sl@0
    12
sl@0
    13
namespace boost { namespace python { namespace converter {
sl@0
    14
sl@0
    15
struct registration;
sl@0
    16
sl@0
    17
// This namespace acts as a sort of singleton
sl@0
    18
namespace registry
sl@0
    19
{
sl@0
    20
  // Get the registration corresponding to the type, creating it if necessary
sl@0
    21
  BOOST_PYTHON_DECL registration const& lookup(type_info);
sl@0
    22
sl@0
    23
  // Get the registration corresponding to the type, creating it if
sl@0
    24
  // necessary.  Use this first when the type is a shared_ptr.
sl@0
    25
  BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info);
sl@0
    26
sl@0
    27
  // Return a pointer to the corresponding registration, if one exists
sl@0
    28
  BOOST_PYTHON_DECL registration const* query(type_info);
sl@0
    29
  
sl@0
    30
  BOOST_PYTHON_DECL void insert(to_python_function_t, type_info);
sl@0
    31
sl@0
    32
  // Insert an lvalue from_python converter
sl@0
    33
  BOOST_PYTHON_DECL void insert(void* (*convert)(PyObject*), type_info);
sl@0
    34
sl@0
    35
  // Insert an rvalue from_python converter
sl@0
    36
  BOOST_PYTHON_DECL void insert(
sl@0
    37
      convertible_function
sl@0
    38
      , constructor_function
sl@0
    39
      , type_info
sl@0
    40
      );
sl@0
    41
  
sl@0
    42
  // Insert an rvalue from_python converter at the tail of the
sl@0
    43
  // chain. Used for implicit conversions
sl@0
    44
  BOOST_PYTHON_DECL void push_back(
sl@0
    45
      convertible_function
sl@0
    46
      , constructor_function
sl@0
    47
      , type_info
sl@0
    48
      );
sl@0
    49
}
sl@0
    50
sl@0
    51
}}} // namespace boost::python::converter
sl@0
    52
sl@0
    53
#endif // REGISTRY_DWA20011127_HPP