21 #ifndef DEPTH_FIRST_ITR_H 22 #define DEPTH_FIRST_ITR_H 24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 29 #include "SheafSystem/any.h" 32 #ifndef STD_UNORDERED_SET_H 33 #include "SheafSystem/std_unordered_set.h" 36 #ifndef POSET_STATE_HANDLE_H 37 #include "SheafSystem/poset_state_handle.h" 41 #include "SheafSystem/std_set.h" 45 #include "SheafSystem/std_stack.h" 49 #include "SheafSystem/subposet.h" 52 #ifndef TOTAL_POSET_MEMBER_H 53 #include "SheafSystem/total_poset_member.h" 180 virtual void attach_item();
186 virtual void detach_item();
206 void initialize_traversal(
const scoped_index& xanchor_id);
223 return (*_filter)[xhub_id];
231 return (*_filter)[xid.
hub_pod()];
237 void initialize_filter();
243 void initialize_filter(
const subposet& xfilter);
261 void initialize_filter(
const std::string& xfilter_name);
266 void release_cover_id_space_iterators();
329 ERASE_COVER_ITERATOR,
333 EXECUTE_PREVISIT_ACTION,
335 EXECUTE_POSTVISIT_ACTION,
352 static const char* iterator_state_names[NOT_A_STATE+1];
470 virtual bool is_initialized()
const;
492 bool descending()
const;
508 bool is_done()
const;
513 virtual void force_is_done();
542 virtual void next(
bool xtruncate);
547 virtual void reset(
bool xreset_markers =
true);
553 int ct(
bool xreset =
false);
558 void clear_has_visited();
592 void put_has_visited(
const scoped_index& xid,
bool xvalue);
598 bool visit_once()
const;
603 void put_visit_once(
bool xvisit_once);
678 virtual bool is_ancestor_of(
const any* other)
const;
688 bool invariant()
const;
795 #endif // ifndef DEPTH_FIRST_ITR_H action_type
The types of action a client should take when the iterator returns control to the client...
void clear_has_visited()
Makes has_visited(i) false for all i.
void put_has_visited(pod_index_type xhub_id, bool xvalue)
Set the visited marker for hub id xhub_id to xvalue. Intended for use reseting iterator without havin...
virtual void initialize_has_visited(const abstract_poset_member &xanchor)
Initializes the has_visited markers.
A client handle for a subposet.
order_type
The types of order in which the iterator will visit the members of the poset. Determines which action...
bool has_visited(pod_index_type xhub_id) const
True if this has already visited member with hub id xhub_id.
An abstract iterator over the ids of an id space.
bool _descending
True if iterating over the up/down set of anchor.
bool filter(pod_index_type xhub_id)
The value of the filter at hub id xhub_id.
iterator_state
The states for the finite state machine that controls iteration.
iterator_state _state
The current state of iteration.
abstract_poset_member * _anchor
The top member of the down set being iterated over.
index_space_iterator * _path_head
The head of the path to the current member of the iteration lesser_index() == this->index() == **_pat...
void reserve_has_visited(pod_index_type xub)
Ensures has_visited(i) is a legal call for 0 <= i < xub.
Abstract base class with useful features for all objects.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
index_space_iterator * _path_head_lc
The lower cover iterator for the head of the path to the current member of the iteration.
The general depth-first iterator over the intersection of a poset member anchor's whole with its down...
iterator_token
The input tokens for the finite state machine.
static const char * NULL_FILTER
Placeholder for null filter.
std::stack< pod_index_type > _filtered_path_tail
The tail of the filtered path to the current member of the iteration. Contains only members which pas...
scoped_index _greater_index
The index of the greater member of the current link.
bool _visit_once
True if traversal should only visit a member once; that is, it should not revisit members it has alre...
An index within the external ("client") scope of a given id space.
bool _new_filter
True if this allocated a new filter;.
bool filter(const scoped_index &xid)
The value of the filter at id xid.
action_type _action
The type of action the client should take; the state of the iterator.
scoped_index _index
The index of the lesser end of the current link; the current item in the iteration.
void next()
Makes this the next member of the subset.
scoped_index _lesser_index
The index of the lesser member of the current link.
int_type pod_index_type
The plain old data index type.
Namespace for the sheaves component of the sheaf system.
std::stack< index_space_iterator * > _path_tail
The tail of the path to the current member of the iteration greater_index() == **(_path_tail.top()) == greater member of current link.
An abstract client handle for a member of a poset.
void truncate()
Makes this the next member of the subset which is not less than old this, i.e. the depth-first descen...
subposet _client_filter
The filter specified by the client.
order_type _order
The order of the iteration.
bool _strict
True if iterating over the strict up/down set of anchor.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.