basic wrapping of Annotations
[mussa.git] / py / annotations.cpp
1 #include <boost/iterator.hpp>
2
3 #include <boost/python.hpp>
4 #include <boost/python/return_value_policy.hpp>
5 #include <boost/python/manage_new_object.hpp>
6
7 #include <boost/python/register_ptr_to_python.hpp>
8 using namespace boost::python;
9
10 #include "alg/annotations.hpp"
11
12 #include "stl_container_adapter.hpp"
13
14 void export_annotations()
15 {
16
17   class_<Annotations>("annotations", init<std::string>())
18     .add_property("name", &Annotations::name, &Annotations::setName)
19     .def("__contains__", &map_item<Annotations>::in)
20     .def("__delitem__", &map_item<Annotations>::del)
21     .def("__getitem__", &map_item<Annotations>::get,
22          return_value_policy<copy_non_const_reference>())
23     .def("__setitem__", &map_item<Annotations>::set)
24     .def("__len__", &Annotations::size)
25     .def("keys", &map_item<Annotations>::keys)
26     .def("values", &map_item<Annotations>::values)
27     .def("items", &map_item<Annotations>::items)
28     ;
29
30   //register_ptr_to_python< AnnotationsRef >();
31 }