fix Python bindings for relabeling_map, and document them
This fixes #61, and addresses one item of #14. * src/ltlvisit/relabel.hh: Use a map rather than a unordered_map, because the Swig binding for unordered_map do not seem functional. * wrap/python/spot_impl.i: Adjust. * wrap/python/tests/relabel.py: New file. * wrap/python/tests/Makefile.am: Add it. * doc/org/tut02.org: New file. * doc/Makefile.am: Add it.
This commit is contained in:
parent
a8f5e7fd8b
commit
6c2985e753
6 changed files with 225 additions and 22 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "ltlast/formula.hh"
|
||||
#include "misc/hash.hh"
|
||||
#include <map>
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
|
@ -29,16 +30,17 @@ namespace spot
|
|||
enum relabeling_style { Abc, Pnn };
|
||||
|
||||
|
||||
struct relabeling_map: public std::unordered_map<const formula*,
|
||||
const formula*,
|
||||
ptr_hash<formula>>
|
||||
struct relabeling_map: public std::map<const formula*,
|
||||
const formula*,
|
||||
formula_ptr_less_than>
|
||||
{
|
||||
void clear()
|
||||
{
|
||||
for (iterator i = begin(); i != end(); ++i)
|
||||
i->second->destroy();
|
||||
this->std::unordered_map<const formula*,
|
||||
const formula*, ptr_hash<formula>>::clear();
|
||||
iterator i = begin();
|
||||
while (i != end())
|
||||
i++->second->destroy();
|
||||
this->std::map<const formula*, const formula*,
|
||||
formula_ptr_less_than>::clear();
|
||||
}
|
||||
|
||||
~relabeling_map()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue