From aaff42ee2218a87c7e1f58caf51ec19fcd09c497 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 29 Oct 2015 17:24:10 +0100 Subject: [PATCH] python: fix output of twa_run * src/twaalgos/emptiness.hh, src/twaalgos/emptiness.cc: Declare the operator<< for twa_run, not for twa_run_ptr (the shared_ptr automatically forward operator<<). * wrap/python/spot_impl.i: Add __str__ to twa_run, not twa_run_ptr. --- src/twaalgos/emptiness.cc | 12 ++++++------ src/twaalgos/emptiness.hh | 2 +- wrap/python/spot_impl.i | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/twaalgos/emptiness.cc b/src/twaalgos/emptiness.cc index f092c1663..73c66a432 100644 --- a/src/twaalgos/emptiness.cc +++ b/src/twaalgos/emptiness.cc @@ -254,9 +254,9 @@ namespace spot } std::ostream& - operator<<(std::ostream& os, const twa_run_ptr& run) + operator<<(std::ostream& os, const twa_run& run) { - auto& a = run->aut; + auto& a = run.aut; bdd_dict_ptr d = a->get_dict(); auto pstep = [&](const twa_run::step& st) @@ -268,11 +268,11 @@ namespace spot os << '\n'; }; - os << "Prefix:" << std::endl; - for (auto& s: run->prefix) + os << "Prefix:\n"; + for (auto& s: run.prefix) pstep(s); - os << "Cycle:" << std::endl; - for (auto& s: run->cycle) + os << "Cycle:\n"; + for (auto& s: run.cycle) pstep(s); return os; } diff --git a/src/twaalgos/emptiness.hh b/src/twaalgos/emptiness.hh index b3e72fd27..ac29a8574 100644 --- a/src/twaalgos/emptiness.hh +++ b/src/twaalgos/emptiness.hh @@ -332,7 +332,7 @@ namespace spot /// actually exists in the automaton (and will also display any /// transition annotation). SPOT_API - friend std::ostream& operator<<(std::ostream& os, const twa_run_ptr& run); + friend std::ostream& operator<<(std::ostream& os, const twa_run& run); }; /// @} diff --git a/wrap/python/spot_impl.i b/wrap/python/spot_impl.i index 298f08a63..0e99b22eb 100644 --- a/wrap/python/spot_impl.i +++ b/wrap/python/spot_impl.i @@ -383,7 +383,7 @@ namespace std { } } -%extend spot::twa_run_ptr { +%extend spot::twa_run { std::string __str__() { std::ostringstream os;