1 // Copyright Joel de Guzman 2005-2006. Distributed under the Boost
2 // Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 #include <boost/python.hpp>
5 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
8 using namespace boost::python
;
13 virtual std::string
f() =0;
16 class Concrete1
: public Abstract
19 virtual std::string
f() { return "harru"; }
22 typedef std::vector
<Abstract
*> ListOfObjects
;
29 ListOfObjects
returnList()
32 lst
.push_back(new Concrete1()); return lst
;
36 BOOST_PYTHON_MODULE(pointer_vector_ext
)
38 class_
<Abstract
, boost::noncopyable
>("Abstract", no_init
)
39 .def("f", &Abstract::f
)
42 class_
<ListOfObjects
>("ListOfObjects")
43 .def( vector_indexing_suite
<ListOfObjects
>() )
46 class_
<DoesSomething
>("DoesSomething")
47 .def("returnList", &DoesSomething::returnList
)