Skip to content
Snippets Groups Projects
Commit 0a452e94 authored by marco's avatar marco
Browse files

more sequence exports and tweak to sequence list iterator export

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2309 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent a2b08e72
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
.def("AddSequence", &C::AddSequence) \
.def("GetMaxLength", &C::GetMaxLength) \
.def("GetMinLength", &C::GetMinLength) \
.def("IsValid", &C::IsValid) \
.def("Take", &C::Take) \
.def("Slice", &C::Slice) \
.def("SequencesHaveEqualLength", \
......
......@@ -136,7 +136,7 @@ private:
struct ConstSeqListIter {
ConstSeqListIter(ConstSequenceList& list):
b_(list.begin()), e_(list.end())
l_(list), b_(l_.begin()), e_(l_.end())
{ }
ConstSequenceHandle next()
......@@ -144,18 +144,19 @@ struct ConstSeqListIter {
if (b_==e_) {
boost::python::objects::stop_iteration_error();
}
ConstSequenceHandle s=*b_;
ConstSequenceHandle s=*b_;
++b_;
return s;
}
private:
ConstSequenceList l_;
ConstSequenceList::iterator b_;
ConstSequenceList::iterator e_;
};
struct SeqListIter {
SeqListIter(SequenceList& list):
b_(list.begin()), e_(list.end())
l_(list), b_(l_.begin()), e_(l_.end())
{ }
SequenceHandle next()
......@@ -168,6 +169,7 @@ struct SeqListIter {
return s;
}
private:
SequenceList l_;
SequenceList::iterator b_;
SequenceList::iterator e_;
};
......@@ -209,6 +211,7 @@ void const_seq_handle_def(O& bp_class)
.def("__getitem__", &C::GetOneLetterCode)
.def("GetSequenceOffset", &C::GetSequenceOffset)
.def("Copy", &C::Copy)
.def("IsValid", &C::IsValid)
.def("GetFirstNonGap", &C::GetFirstNonGap)
.def("GetLastNonGap", &C::GetLastNonGap)
.add_property("first_non_gap", &C::GetFirstNonGap)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment