Commit aaff42ee authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

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.
parent f6af2a84
...@@ -254,9 +254,9 @@ namespace spot ...@@ -254,9 +254,9 @@ namespace spot
} }
std::ostream& 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(); bdd_dict_ptr d = a->get_dict();
auto pstep = [&](const twa_run::step& st) auto pstep = [&](const twa_run::step& st)
...@@ -268,11 +268,11 @@ namespace spot ...@@ -268,11 +268,11 @@ namespace spot
os << '\n'; os << '\n';
}; };
os << "Prefix:" << std::endl; os << "Prefix:\n";
for (auto& s: run->prefix) for (auto& s: run.prefix)
pstep(s); pstep(s);
os << "Cycle:" << std::endl; os << "Cycle:\n";
for (auto& s: run->cycle) for (auto& s: run.cycle)
pstep(s); pstep(s);
return os; return os;
} }
......
...@@ -332,7 +332,7 @@ namespace spot ...@@ -332,7 +332,7 @@ namespace spot
/// actually exists in the automaton (and will also display any /// actually exists in the automaton (and will also display any
/// transition annotation). /// transition annotation).
SPOT_API 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);
}; };
/// @} /// @}
......
...@@ -383,7 +383,7 @@ namespace std { ...@@ -383,7 +383,7 @@ namespace std {
} }
} }
%extend spot::twa_run_ptr { %extend spot::twa_run {
std::string __str__() std::string __str__()
{ {
std::ostringstream os; std::ostringstream os;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment