Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:37

0001 //  Copyright David Abrahams 2001.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef REGISTRY_DWA20011127_HPP
0006 # define REGISTRY_DWA20011127_HPP
0007 # include <boost/python/type_id.hpp>
0008 # include <boost/python/converter/to_python_function_type.hpp>
0009 # include <boost/python/converter/rvalue_from_python_data.hpp>
0010 # include <boost/python/converter/constructor_function.hpp>
0011 # include <boost/python/converter/convertible_function.hpp>
0012 
0013 namespace boost { namespace python { namespace converter {
0014 
0015 struct registration;
0016 
0017 // This namespace acts as a sort of singleton
0018 namespace registry
0019 {
0020   // Get the registration corresponding to the type, creating it if necessary
0021   BOOST_PYTHON_DECL registration const& lookup(type_info);
0022 
0023   // Get the registration corresponding to the type, creating it if
0024   // necessary.  Use this first when the type is a shared_ptr.
0025   BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info);
0026 
0027   // Return a pointer to the corresponding registration, if one exists
0028   BOOST_PYTHON_DECL registration const* query(type_info);
0029   
0030   BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0);
0031 
0032   // Insert an lvalue from_python converter
0033   BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0);
0034 
0035   // Insert an rvalue from_python converter
0036   BOOST_PYTHON_DECL void insert(
0037       convertible_function
0038       , constructor_function
0039       , type_info
0040       , PyTypeObject const* (*expected_pytype)()  = 0
0041       );
0042   
0043   // Insert an rvalue from_python converter at the tail of the
0044   // chain. Used for implicit conversions
0045   BOOST_PYTHON_DECL void push_back(
0046       convertible_function
0047       , constructor_function
0048       , type_info
0049       , PyTypeObject const* (*expected_pytype)()  = 0
0050       );
0051 }
0052 
0053 }}} // namespace boost::python::converter
0054 
0055 #endif // REGISTRY_DWA20011127_HPP