56#define IS_SHARED_PTR_DWA2003224_HPP
58#include <boost/python/detail/is_xxx.hpp>
59#include <boost/shared_ptr.hpp>
69BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1)
83#include <boost/python/type_id.hpp>
84#include <boost/python/converter/registry.hpp>
85#include <boost/python/converter/registrations.hpp>
86#include <boost/type_traits/transform_traits.hpp>
88#include <boost/type_traits/cv_traits.hpp>
89#include <boost/type_traits/is_void.hpp>
90#include <boost/detail/workaround.hpp>
91#include <boost/type.hpp>
106 registry::lookup_shared_ptr(type_id<std::shared_ptr<T>>());
117#define VALUE_IS_SHARED_PTR_DWA2003224_HPP
118#include <boost/python/detail/value_is_xxx.hpp>
119#include <boost/python/detail/is_shared_ptr.hpp>
132 typename remove_cv<typename remove_reference<X_>::type>
::type>
::value;
133 typedef mpl::bool_<value>
type;
145#define SHARED_PTR_FROM_PYTHON_DWA20021130_HPP
147#include <boost/python/handle.hpp>
148#include <boost/python/converter/shared_ptr_deleter.hpp>
149#include <boost/python/converter/from_python.hpp>
150#include <boost/python/converter/rvalue_from_python_data.hpp>
151#include <boost/python/converter/registered.hpp>
152#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
153#include <boost/python/converter/pytype_function.hpp>
155#include <boost/shared_ptr.hpp>
165template <
class T,
template <
typename>
class SP>
170 converter::registry::insert(
172#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
174 &converter::expected_from_python_type_direct<T>::get_pytype
185 return converter::get_lvalue_from_python(
p, registered<T>::converters);
189 rvalue_from_python_stage1_data *data)
191 void *
const storage =
192 ((converter::rvalue_from_python_storage<SP<T>> *)data)
195 if (data->convertible == source)
196 new (storage) SP<T>();
199 SP<void> hold_convertible_ref_count(
200 (
void *)0, shared_ptr_deleter(handle<>(borrowed(source))));
202 new (storage) SP<T>(hold_convertible_ref_count,
203 static_cast<T *
>(data->convertible));
206 data->convertible = storage;
230#include <boost/python/refcount.hpp>
231#include <boost/python/converter/shared_ptr_deleter.hpp>
232#include <boost/python/detail/none.hpp>
233#include <boost/get_pointer.hpp>
246 return python::detail::none();
247 else if (shared_ptr_deleter *
d = std::get_deleter<shared_ptr_deleter>(x))
248 return incref(get_pointer(
d->owner));
250 return converter::registered<std::shared_ptr<T>
const &>::converters
265#define TO_PYTHON_VALUE_DWA200221_HPP
266#include <boost/python/detail/prefix.hpp>
268#include <boost/python/refcount.hpp>
269#include <boost/python/tag.hpp>
270#include <boost/python/handle.hpp>
272#include <boost/python/converter/registry.hpp>
273#include <boost/python/converter/registered.hpp>
274#include <boost/python/converter/builtin_converters.hpp>
275#include <boost/python/converter/object_manager.hpp>
276#include <boost/python/converter/shared_ptr_to_python.hpp>
278#include <boost/python/detail/value_is_shared_ptr.hpp>
279#include <boost/python/detail/value_arg.hpp>
281#include <boost/type_traits/transform_traits.hpp>
283#include <boost/mpl/if.hpp>
284#include <boost/mpl/or.hpp>
285#include <boost/type_traits/is_const.hpp>
295#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
299 template <
class U>
static PyTypeObject
const *
get(U &(*)() = 0)
301 return converter::object_manager_traits<U>::get_pytype();
307 template <
class U>
static PyTypeObject
const *
get(U
const &(*)() = 0)
309 return converter::object_manager_traits<U>::get_pytype();
320#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
322 typedef boost::detail::indirect_traits::is_reference_to_const<T>
is_t_const;
330 return converter::object_manager_traits<T>::get_pytype();
351#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
354 return converter::registered<T>::converters.to_python_target_type();
369#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
372 return get_pytype((boost::type<argument_type> *)0);
381#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
383 PyTypeObject
const *
get_pytype(boost::type<shared_ptr<U> &> *)
const
385 return converter::registered<U>::converters.to_python_target_type();
388 PyTypeObject
const *
get_pytype(boost::type<
const shared_ptr<U> &> *)
const
390 return converter::registered<U>::converters.to_python_target_type();
392#if __cplusplus >= 201103L
394 PyTypeObject
const *
get_pytype(boost::type<std::shared_ptr<U> &> *)
const
396 return converter::registered<U>::converters.to_python_target_type();
400 boost::type<
const std::shared_ptr<U> &> *)
const
402 return converter::registered<U>::converters.to_python_target_type();
411 : mpl::if_<detail::value_is_shared_ptr<T>,
412 detail::shared_ptr_to_python_value<T>,
414 mpl::or_<converter::is_object_manager<T>,
415 converter::is_reference_to_object_manager<T>>,
416 detail::object_manager_to_python_value<T>,
417 detail::registry_to_python_value<T>>::type>::type
429 return converter::registered<argument_type>::converters.to_python(&x);
436 return python::upcast<PyObject>(
437 python::xincref(get_managed_object(x, tag)));
std::vector< double > d(NPUPPER *NPUPPER)
void register_shared_ptr0(std::shared_ptr< T > *)
PyObject * shared_ptr_to_python(std::shared_ptr< T > const &x)
static void construct(PyObject *source, rvalue_from_python_stage1_data *data)
shared_ptr_from_python_new()
static void * convertible(PyObject *p)
static PyTypeObject const * get(U const &(*)()=0)
static PyTypeObject const * get(U &(*)()=0)
PyTypeObject const * get_pytype() const
boost::detail::indirect_traits::is_reference_to_const< T > is_t_const
static PyTypeObject const * get_pytype_aux(mpl::false_ *)
PyObject * operator()(argument_type) const
boost::mpl::bool_< is_handle< T >::value > is_t_handle
BOOST_STATIC_CONSTANT(bool, uses_registry=false)
static PyTypeObject const * get_pytype_aux(mpl::true_ *)
value_arg< T >::type argument_type
PyTypeObject const * get_pytype() const
BOOST_STATIC_CONSTANT(bool, uses_registry=true)
PyObject * operator()(argument_type) const
value_arg< T >::type argument_type
PyTypeObject const * get_pytype(boost::type< const shared_ptr< U > & > *) const
PyTypeObject const * get_pytype() const
PyTypeObject const * get_pytype(boost::type< shared_ptr< U > & > *) const
PyObject * operator()(argument_type) const
value_arg< T >::type argument_type
BOOST_STATIC_CONSTANT(bool, uses_registry=false)
Template type to determine whether.