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