1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/converter/registry.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,53 @@
1.4 +// Copyright David Abrahams 2001.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef REGISTRY_DWA20011127_HPP
1.9 +# define REGISTRY_DWA20011127_HPP
1.10 +# include <boost/python/type_id.hpp>
1.11 +# include <boost/python/converter/to_python_function_type.hpp>
1.12 +# include <boost/python/converter/rvalue_from_python_data.hpp>
1.13 +# include <boost/python/converter/constructor_function.hpp>
1.14 +# include <boost/python/converter/convertible_function.hpp>
1.15 +
1.16 +namespace boost { namespace python { namespace converter {
1.17 +
1.18 +struct registration;
1.19 +
1.20 +// This namespace acts as a sort of singleton
1.21 +namespace registry
1.22 +{
1.23 + // Get the registration corresponding to the type, creating it if necessary
1.24 + BOOST_PYTHON_DECL registration const& lookup(type_info);
1.25 +
1.26 + // Get the registration corresponding to the type, creating it if
1.27 + // necessary. Use this first when the type is a shared_ptr.
1.28 + BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info);
1.29 +
1.30 + // Return a pointer to the corresponding registration, if one exists
1.31 + BOOST_PYTHON_DECL registration const* query(type_info);
1.32 +
1.33 + BOOST_PYTHON_DECL void insert(to_python_function_t, type_info);
1.34 +
1.35 + // Insert an lvalue from_python converter
1.36 + BOOST_PYTHON_DECL void insert(void* (*convert)(PyObject*), type_info);
1.37 +
1.38 + // Insert an rvalue from_python converter
1.39 + BOOST_PYTHON_DECL void insert(
1.40 + convertible_function
1.41 + , constructor_function
1.42 + , type_info
1.43 + );
1.44 +
1.45 + // Insert an rvalue from_python converter at the tail of the
1.46 + // chain. Used for implicit conversions
1.47 + BOOST_PYTHON_DECL void push_back(
1.48 + convertible_function
1.49 + , constructor_function
1.50 + , type_info
1.51 + );
1.52 +}
1.53 +
1.54 +}}} // namespace boost::python::converter
1.55 +
1.56 +#endif // REGISTRY_DWA20011127_HPP