stats: preparatory change of the implementation of %c
This now holds the scc_info while processing the %c sequence, so that using options we will soon be able to specify which SCC to count. * spot/twaalgos/stats.hh, spot/twaalgos/stats.cc (printable_scc_info): New class. (state_printer): Use it for %c. * spot/misc/formater.hh: Add move assignment. * bin/common_aoutput.hh, bin/common_aoutput.cc: Use printable_scc_info for %C. * tests/core/format.test: Add a quick test case to make sure nothing changed.
This commit is contained in:
parent
70de1328d8
commit
4f0a630dbc
6 changed files with 47 additions and 5 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <spot/twa/twa.hh>
|
||||
#include <spot/twaalgos/sccinfo.hh>
|
||||
#include <iosfwd>
|
||||
#include <spot/misc/formater.hh>
|
||||
|
||||
|
|
@ -69,6 +70,24 @@ namespace spot
|
|||
print(std::ostream& os, const char*) const override;
|
||||
};
|
||||
|
||||
class SPOT_API printable_scc_info final:
|
||||
public spot::printable
|
||||
{
|
||||
std::unique_ptr<scc_info> val_;
|
||||
public:
|
||||
void automaton(const const_twa_graph_ptr& aut)
|
||||
{
|
||||
val_ = std::unique_ptr<scc_info>(new scc_info(aut));
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
val_ = nullptr;
|
||||
}
|
||||
|
||||
void print(std::ostream& os, const char* pos) const override;
|
||||
};
|
||||
|
||||
/// \brief prints various statistics about a TGBA
|
||||
///
|
||||
/// This object can be configured to display various statistics
|
||||
|
|
@ -95,7 +114,7 @@ namespace spot
|
|||
printable_value<unsigned> edges_;
|
||||
printable_value<unsigned> trans_;
|
||||
printable_value<unsigned> acc_;
|
||||
printable_value<unsigned> scc_;
|
||||
printable_scc_info scc_;
|
||||
printable_value<unsigned> nondetstates_;
|
||||
printable_value<unsigned> deterministic_;
|
||||
printable_value<unsigned> complete_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue