26 #ifndef BOOST_PYTHON_INDEXING_SHARED_PROXY_IMPL_HPP
27 #define BOOST_PYTHON_INDEXING_SHARED_PROXY_IMPL_HPP
30 #include <indexing_suite/workaround.hpp>
32 namespace boost {
namespace python {
namespace indexing {
33 template<
class ContainerProxy>
37 typedef typename ContainerProxy::raw_value_type value_type;
38 typedef value_type &reference;
39 typedef value_type *pointer;
40 typedef void iterator_category;
41 typedef void difference_type;
43 reference operator*()
const;
44 pointer operator->()
const {
return &(**this); }
46 ContainerProxy *owner()
const {
return m_owner_ptr; }
47 size_t index()
const {
return m_index; }
52 #if defined (BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
62 ContainerProxy *m_owner_ptr;
64 std::auto_ptr<value_type> m_element_ptr;
72 template<
class ContainerProxy>
75 : m_owner_ptr (owner),
81 template<
class ContainerProxy>
82 shared_proxy_impl<ContainerProxy>::shared_proxy_impl (value_type
const &val)
84 m_index (static_cast<size_t>(-1)),
85 m_element_ptr (new value_type (val))
89 template<
class ContainerProxy>
90 typename shared_proxy_impl<ContainerProxy>::reference
91 shared_proxy_impl<ContainerProxy>::operator* ()
const
94 ? m_owner_ptr->raw_container().BOOST_PYTHON_INDEXING_AT (m_index)
98 template<
class ContainerProxy>
99 void shared_proxy_impl<ContainerProxy>::detach ()
101 BOOST_PYTHON_INDEXING_RESET_AUTO_PTR(
102 m_element_ptr,
new value_type (**
this));
104 m_index =
static_cast<size_t>(-1);
108 #endif // BOOST_PYTHON_INDEXING_SHARED_PROXY_IMPL_HPP
Definition: python_CEGUI.h:11
Definition: container_proxy.hpp:103
Definition: shared_proxy_impl.hpp:34