make Sequence a subclass of std::string
[mussa.git] / py / sequence.cpp
1 #include <boost/python.hpp>
2 #include <boost/python/return_internal_reference.hpp>
3 #include <boost/python/return_by_value.hpp>
4 #include <boost/python/return_value_policy.hpp>
5 using namespace boost::python;
6
7 #include <string>
8 #include "alg/glsequence.hpp"
9
10 void export_sequence()
11 {
12   class_<Sequence>("Sequence")
13     .def(init<std::string>())
14     //.def("__str__", &Sequence::get_seq, return_value_policy<return_by_value>())
15     .def("size", &Sequence::size)
16     .def("__len__", &Sequence::size)
17     .add_property("header", &Sequence::get_header, &Sequence::set_header)
18     //.add_property("seq", &Sequence::get_seq, &Sequence::set_seq)
19     .def("rcseq", &Sequence::rev_comp, return_value_policy<return_by_value>())
20   ;
21 }