Chris@16: // Copyright David Abrahams 2001. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef REGISTRY_DWA20011127_HPP Chris@16: # define REGISTRY_DWA20011127_HPP Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: namespace boost { namespace python { namespace converter { Chris@16: Chris@16: struct registration; Chris@16: Chris@16: // This namespace acts as a sort of singleton Chris@16: namespace registry Chris@16: { Chris@16: // Get the registration corresponding to the type, creating it if necessary Chris@16: BOOST_PYTHON_DECL registration const& lookup(type_info); Chris@16: Chris@16: // Get the registration corresponding to the type, creating it if Chris@16: // necessary. Use this first when the type is a shared_ptr. Chris@16: BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info); Chris@16: Chris@16: // Return a pointer to the corresponding registration, if one exists Chris@16: BOOST_PYTHON_DECL registration const* query(type_info); Chris@16: Chris@16: BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0); Chris@16: Chris@16: // Insert an lvalue from_python converter Chris@16: BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0); Chris@16: Chris@16: // Insert an rvalue from_python converter Chris@16: BOOST_PYTHON_DECL void insert( Chris@16: convertible_function Chris@16: , constructor_function Chris@16: , type_info Chris@16: , PyTypeObject const* (*expected_pytype)() = 0 Chris@16: ); Chris@16: Chris@16: // Insert an rvalue from_python converter at the tail of the Chris@16: // chain. Used for implicit conversions Chris@16: BOOST_PYTHON_DECL void push_back( Chris@16: convertible_function Chris@16: , constructor_function Chris@16: , type_info Chris@16: , PyTypeObject const* (*expected_pytype)() = 0 Chris@16: ); Chris@16: } Chris@16: Chris@16: }}} // namespace boost::python::converter Chris@16: Chris@16: #endif // REGISTRY_DWA20011127_HPP