20 #include "SheafSystem/index_iterator.h" 21 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/std_bitset.h" 24 #include "SheafSystem/std_limits.h" 25 #include "SheafSystem/zn_to_bool.h" 69 reset(xhost, xid_space, xdelete_host);
130 ensure((*
host())[result]);
156 ensure((*
host())[result.pod()]);
209 ensure(unexecutable(result implies
is_done() after
next()));
273 define_old_variable(
int old_item =
_item);
298 require(
host() != 0);
340 _bit_ub = zn_to_bool::BITS_PER_WORD;
const scoped_index & index() const
The current item in the subset.
int item()
OBSOLETE: use index(). The current item in the subset.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
const zn_to_bool * host() const
The subset this is iterating over.
int _word_ub
The upper bound for the word index.
index_iterator()
Creates an instance with host() == 0.
void next()
Makes item the next member of the subset.
scoped_index _index
The current index in the iteration.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
int _item_ub
The upper bound in item.
void put_scope(const index_space_handle &xid_space)
Sets the scope to xid_space.
void find_next_item()
Finds the next item in the iteration.
unsigned int _word
The current word.
bool _delete_host
True if _host should be deleted when this is deleted.
An index within the external ("client") scope of a given id space.
int _bit_ub
The upper bound on the bit index.
const zn_to_bool * _host
The subset this is iterating over.
int _item
The current item in the iteration.
int _bit_index
The index of the current bit.
bool is_done() const
True if iteration finished.
virtual ~index_iterator()
Destructor; not virtual so this class should not be used as a base class.
int _next_item
The next item in the iteration.
void reset()
Restarts the iteration, makes item the first member of the subset.
int _word_index
The index of the word containing the current bit.
bool is_last() const
True if iteration finished after next call to next()