~ubuntu-branches/debian/sid/boost1.49/sid

« back to all changes in this revision

Viewing changes to boost/python/register_ptr_to_python.hpp

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2012-02-26 00:31:44 UTC
  • Revision ID: package-import@ubuntu.com-20120226003144-eaytp12cbf6ubpms
Tags: upstream-1.49.0
ImportĀ upstreamĀ versionĀ 1.49.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright David Abrahams 2002.
 
2
// Distributed under the Boost Software License, Version 1.0. (See
 
3
// accompanying file LICENSE_1_0.txt or copy at
 
4
// http://www.boost.org/LICENSE_1_0.txt)
 
5
#ifndef REGISTER_PTR_TO_PYTHON_HPP
 
6
#define REGISTER_PTR_TO_PYTHON_HPP
 
7
 
 
8
#include <boost/python/pointee.hpp>
 
9
#include <boost/python/object.hpp>
 
10
#include <boost/python/object/class_wrapper.hpp>
 
11
 
 
12
namespace boost { namespace python {
 
13
    
 
14
template <class P>
 
15
void register_ptr_to_python(BOOST_EXPLICIT_TEMPLATE_TYPE(P))
 
16
{
 
17
    typedef typename boost::python::pointee<P>::type X;
 
18
    objects::class_value_wrapper<
 
19
        P
 
20
      , objects::make_ptr_instance<
 
21
            X
 
22
          , objects::pointer_holder<P,X>
 
23
        >
 
24
    >();
 
25
}           
 
26
 
 
27
}} // namespace boost::python
 
28
 
 
29
#endif // REGISTER_PTR_TO_PYTHON_HPP
 
30
 
 
31