os/ossrv/ossrv_pub/boost_apis/boost/python/wrapper.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/wrapper.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,35 @@
     1.4 +// Copyright David Abrahams 2004. Distributed under the Boost
     1.5 +// Software License, Version 1.0. (See accompanying
     1.6 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.7 +#ifndef WRAPPER_DWA2004720_HPP
     1.8 +# define WRAPPER_DWA2004720_HPP
     1.9 +
    1.10 +# include <boost/python/detail/wrapper_base.hpp>
    1.11 +# include <boost/python/override.hpp>
    1.12 +# include <boost/python/converter/registered.hpp>
    1.13 +# include <boost/python/detail/sfinae.hpp>
    1.14 +
    1.15 +namespace boost { namespace python { 
    1.16 +
    1.17 +template <class T>
    1.18 +class wrapper : public detail::wrapper_base
    1.19 +{
    1.20 + public:
    1.21 +    // Do not touch this implementation detail!
    1.22 +    typedef T _wrapper_wrapped_type_;
    1.23 +
    1.24 + protected:
    1.25 +    override get_override(char const* name) const
    1.26 +    {
    1.27 +        typedef detail::wrapper_base base;
    1.28 +        converter::registration const& r
    1.29 +            = converter::registered<T>::converters;
    1.30 +        PyTypeObject* type = r.get_class_object();
    1.31 +        
    1.32 +        return this->base::get_override(name, type);
    1.33 +    }
    1.34 +};
    1.35 +
    1.36 +}} // namespace boost::python
    1.37 +
    1.38 +#endif // WRAPPER_DWA2004720_HPP