python: port the tut22.org example to Python

* wrap/python/spot_impl.i: Extend acc_cond::mark_t to with a constructor
that takes a vector.
* doc/org/tut22.org: Add a Python version.
* doc/org/tut.org: Adjust the list, we don't have any C++-specific
example.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2015-12-15 19:01:33 +01:00
parent 9313222e95
commit c39d35d068
4 changed files with 82 additions and 15 deletions

View file

@ -317,6 +317,7 @@ namespace swig
namespace std {
%template(liststr) list<std::string>;
%template(vectorformula) vector<spot::formula>;
%template(vectorunsigned) vector<unsigned>;
%template(atomic_prop_set) set<spot::formula>;
%template(relabeling_map) map<spot::formula, spot::formula>;
}
@ -330,6 +331,7 @@ namespace std {
%include <spot/twa/bdddict.hh>
%include <spot/twa/bddprint.hh>
%include <spot/twa/fwd.hh>
%implicitconv spot::acc_cond::mark_t;
%feature("flatnested") spot::acc_cond::mark_t;
%feature("flatnested") spot::acc_cond::acc_code;
%apply bool* OUTPUT {bool& max, bool& odd};
@ -439,6 +441,14 @@ namespace std {
std::string __str__() { return spot::str_psl(*self); }
}
%extend spot::acc_cond::mark_t {
// http://comments.gmane.org/gmane.comp.programming.swig/14822
mark_t(const std::vector<unsigned>& f)
{
return new spot::acc_cond::mark_t(f.begin(), f.end());
}
}
%extend spot::twa {
void set_name(std::string name)
{