* src/tgbaalgos/ndfs_result.hxx (ndfs_result, acss_interface):
Conditionally inherit from acss_statistics. * src/tgbaalgos/magic.cc, src/tgbaalgos/se05.cc, src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: Define Has_Size in all heaps.
This commit is contained in:
parent
603b49e216
commit
7c07f3149f
6 changed files with 42 additions and 19 deletions
|
|
@ -61,11 +61,37 @@ namespace spot
|
|||
|
||||
typedef std::list<stack_item> stack_type;
|
||||
|
||||
namespace
|
||||
{
|
||||
// The acss_statistics is available only when the heap has a
|
||||
// size() method (which we indicate using n==1).
|
||||
|
||||
template <typename T, int n>
|
||||
struct acss_interface
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct acss_interface<T, 1>
|
||||
: public acss_statistics
|
||||
{
|
||||
int
|
||||
acss_states() const
|
||||
{
|
||||
// all visited states are in the state space search
|
||||
return dynamic_cast<const T*>(this)->h_.size();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <typename ndfs_search, typename heap>
|
||||
class ndfs_result:
|
||||
public emptiness_check_result,
|
||||
public ars_statistics,
|
||||
public acss_statistics
|
||||
// Conditionally inherit from acss_statistics.
|
||||
public acss_interface<ndfs_result<ndfs_search, heap>, heap::Has_Size>
|
||||
{
|
||||
public:
|
||||
ndfs_result(const ndfs_search& ms)
|
||||
|
|
@ -74,12 +100,6 @@ namespace spot
|
|||
{
|
||||
}
|
||||
|
||||
int acss_states() const
|
||||
{
|
||||
// all visited states are in the state space search
|
||||
return h_.size();
|
||||
}
|
||||
|
||||
virtual ~ndfs_result()
|
||||
{
|
||||
}
|
||||
|
|
@ -195,6 +215,8 @@ namespace spot
|
|||
private:
|
||||
const ndfs_search& ms_;
|
||||
const heap& h_;
|
||||
template <typename T, int n>
|
||||
friend struct acss_interface;
|
||||
|
||||
struct transition {
|
||||
const state* source;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue