6 #ifndef INDEXING_SUITE_JDG20036_HPP
7 # define INDEXING_SUITE_JDG20036_HPP
9 # include <boost/python/class.hpp>
10 # include <boost/python/def_visitor.hpp>
11 # include <boost/python/register_ptr_to_python.hpp>
13 # include <boost/python/return_internal_reference.hpp>
14 # include <boost/python/iterator.hpp>
15 # include <boost/mpl/or.hpp>
16 # include <boost/mpl/not.hpp>
18 namespace boost {
namespace python {
99 ,
class DerivedPolicies
100 ,
bool NoProxy =
false
101 ,
bool NoSlice =
false
102 ,
class Data =
typename Container::value_type
103 ,
class Index =
typename Container::size_type
104 ,
class Key =
typename Container::value_type
122 , mpl::not_<is_class<Data> > >
128 #if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
134 typedef typename mpl::if_<
136 , iterator<Container>
137 , iterator<Container, return_policy> >::type
140 typedef typename mpl::if_<
154 typedef typename mpl::if_<
172 template <
class Class>
176 proxy_handler::register_container_element();
187 DerivedPolicies::extension_def(cl);
190 template <
class Class>
203 if (PySlice_Check(i))
204 return slice_handler::base_get_slice(
205 container.get(),
reinterpret_cast<PySliceObject*
>(i));
207 return proxy_handler::base_get_item_(container, i);
213 if (PySlice_Check(i))
215 slice_handler::base_set_slice(container,
216 reinterpret_cast<PySliceObject*>(i), v);
220 extract<Data&> elem(v);
227 convert_index(container, i), elem());
232 extract<Data> elem(v);
238 convert_index(container, i), elem());
242 PyErr_SetString(PyExc_TypeError,
"Invalid assignment");
243 throw_error_already_set();
252 if (PySlice_Check(i))
254 slice_handler::base_delete_slice(
255 container, reinterpret_cast<PySliceObject*>(i));
259 Index index = DerivedPolicies::convert_index(container, i);
260 proxy_handler::base_erase_index(container, index, mpl::bool_<NoSlice>());
261 DerivedPolicies::delete_item(container, index);
267 return DerivedPolicies::size(container);
273 extract<Key const&>
x(key);
277 return DerivedPolicies::contains(container,
x());
284 return DerivedPolicies::contains(container,
x());
293 #endif // INDEXING_SUITE_JDG20036_HPP