CCuddFirstIter.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_iterators_CCuddFirstIter_h_
#define polybori_iterators_CCuddFirstIter_h_
// include basic definitions
#include "CCuddNavigator.h"
// include boost's interator facade
#include <boost/iterator/iterator_facade.hpp>
BEGIN_NAMESPACE_PBORI
class CCuddFirstIter :
public boost::iterator_facade<
CCuddFirstIter,
CCuddNavigator::value_type,
std::forward_iterator_tag,
CCuddNavigator::reference
> {
public:
typedef std::forward_iterator_tag iterator_category;
typedef CCuddFirstIter self;
typedef CCuddNavigator navigator;
typedef navigator::const_access_type const_access_type;
typedef navigator::bool_type bool_type;
CCuddFirstIter(): m_navi() {}
CCuddFirstIter(navigator rhs): m_navi(rhs) { terminateConstant(); }
~CCuddFirstIter() {}
void increment() {
m_navi.incrementThen();
terminateConstant();
}
bool_type equal (const self& rhs) const { return (m_navi == rhs.m_navi); }
navigator::reference dereference() const { return *m_navi; }
bool_type isEnd() const { return !m_navi.isValid(); }
protected:
void terminateConstant() {
if (m_navi.isConstant())
*this = self(); // mark end of path reached
}
navigator m_navi;
};
END_NAMESPACE_PBORI
#endif
polybori::CCuddFirstIter::CCuddFirstIter
CCuddFirstIter(navigator rhs)
Construct from navigator over nodes.
Definition: CCuddFirstIter.h:64
polybori::CCuddFirstIter::terminateConstant
void terminateConstant()
Constant nodes are marked as the end of a path.
Definition: CCuddFirstIter.h:86
polybori::CCuddFirstIter::CCuddFirstIter
CCuddFirstIter()
Default constructor.
Definition: CCuddFirstIter.h:61
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
polybori::CCuddFirstIter::dereference
navigator::reference dereference() const
Dereferencing of the iterator.
Definition: CCuddFirstIter.h:79
polybori::CCuddFirstIter::navigator
CCuddNavigator navigator
Get navigator type.
Definition: CCuddFirstIter.h:52
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::CCuddNavigator::reference
value_type reference
Definition: CCuddNavigator.h:71
polybori::CCuddNavigator::bool_type
CTypes::bool_type bool_type
Type for boolean results.
Definition: CCuddNavigator.h:58
polybori::CCuddFirstIter::bool_type
navigator::bool_type bool_type
Type for boolean values.
Definition: CCuddFirstIter.h:58
polybori::CCuddFirstIter::equal
bool_type equal(const self &rhs) const
Equality test.
Definition: CCuddFirstIter.h:76
polybori::CCuddFirstIter::~CCuddFirstIter
~CCuddFirstIter()
Destructor.
Definition: CCuddFirstIter.h:67
CCuddNavigator.h
polybori::CCuddFirstIter::isEnd
bool_type isEnd() const
Check, whether end of iteration is reached.
Definition: CCuddFirstIter.h:82
polybori::CCuddFirstIter::const_access_type
navigator::const_access_type const_access_type
Type for constantly accessing node pointer.
Definition: CCuddFirstIter.h:55
polybori::CCuddFirstIter
This class defines an iterator over the first minimal term of a given ZDD node.
Definition: CCuddFirstIter.h:35
polybori::CCuddNavigator::const_access_type
const pointer_type const_access_type
Type for constantly accessing node pointer.
Definition: CCuddNavigator.h:43
polybori::CCuddFirstIter::increment
void increment()
Incrementation operation.
Definition: CCuddFirstIter.h:70
polybori::CCuddFirstIter::m_navi
navigator m_navi
Use navigator to access diagram nodes.
Definition: CCuddFirstIter.h:93
polybori::CCuddNavigator
This class defines an iterator for navigating through then and else branches of ZDDs.
Definition: CCuddNavigator.h:36
polybori::CCuddFirstIter::iterator_category
std::forward_iterator_tag iterator_category
Interface type for standard iterator access.
Definition: CCuddFirstIter.h:46