21 #include "SheafSystem/section_space_schema_jims_index_space_iterator.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/explicit_index_space_handle.h" 25 #include "SheafSystem/ij_product_structure.h" 26 #include "SheafSystem/index_space_family.h" 27 #include "SheafSystem/section_space_schema_jims_index_space_state.h" 47 ensure(!is_attached());
66 ensure((*
this) == xother);
79 require(conforms_to_state(xid_spaces, xindex));
83 attach_to(xid_spaces, xindex);
88 ensure(is_attached());
89 ensure(&id_spaces() == &xid_spaces);
90 ensure(index() == xindex);
99 const std::string& xname)
103 require(conforms_to_state(xid_spaces, xname));
107 attach_to(xid_spaces, xname);
112 ensure(is_attached());
113 ensure(&id_spaces() == &xid_spaces);
114 ensure(name() == xname);
140 (void) explicit_index_space_iterator::operator=(xother);
150 ensure((*
this) == xother);
199 ensure(is_basic_query);
219 ensure(is_basic_query);
241 require(is_ancestor_of(&xother));
248 (void) this->
operator=(lother);
253 ensure((*
this) == xother);
266 require(is_ancestor_of(&xother));
271 if(result && is_attached())
306 ensure(is_same_type(result));
307 ensure(*result == *
this);
326 ensure(is_basic_query);
330 return *_base_space_itr;
343 ensure(is_basic_query);
347 return *_fiber_schema_itr;
356 require(!base_space_iterator().is_done());
357 require(!fiber_schema_iterator().is_done());
361 _section_space_schema_jims_product->ordinal(_base_space_itr->pod(),
362 _fiber_schema_itr->pod(),
365 _section_space_schema_product->ordinal(_base_space_itr->hub_pod(),
366 _fiber_schema_itr->hub_pod(),
393 require(is_attached());
398 define_old_variable(
pod_type old_pod = pod());
399 define_old_variable(
pod_type old_hub_pod = hub_pod());
403 _fiber_schema_itr->next();
405 if(_fiber_schema_itr->is_done())
410 _base_space_itr->next();
412 if(_base_space_itr->is_done())
424 _fiber_schema_itr->reset();
438 ensure(is_done() || pod() != old_pod);
439 ensure(is_done() || hub_pod() != old_hub_pod);
452 require(is_attached());
458 _base_space_itr->reset();
459 _fiber_schema_itr->reset();
461 if(_base_space_itr->is_done() || _fiber_schema_itr->is_done())
502 require(xstate != 0);
503 require(conforms_to_state(xstate));
511 _fiber_schema_itr = &state().fiber_schema().get_iterator();
512 _section_space_schema_jims_product = state().product_structure().
clone();
513 _section_space_schema_product = state().section_space_schema_product_structure().
clone();
522 ensure(is_attached());
523 ensure(&state() == xstate);
524 ensure(!is_done() ? pod() >= 0 :
true);
525 ensure(!is_done() ?
is_valid(hub_pod()) :
true);
540 state().base_space().release_iterator(*_base_space_itr);
541 state().fiber_schema().release_iterator(*_fiber_schema_itr);
542 delete _section_space_schema_jims_product;
543 delete _section_space_schema_product;
549 ensure(!is_attached());
568 ensure(is_basic_query);
611 if(invariant_check())
619 disable_invariant_check();
625 enable_invariant_check();
index_space_iterator * _fiber_schema_itr
The fiber schema jims id space iterator.
virtual void reset()
Restarts the iteration.
virtual void attach_to(explicit_index_space_state *xstate)
Attach to the explicit id space state xstate.
An abstract iterator over the ids of an id space.
virtual void detach()
Detach this iterator form its state, if any.
index_space_iterator & base_space_iterator()
The base space jims id space iterator.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
ij_product_structure * _section_space_schema_jims_product
The product structure of the section space schema jims id space.
ij_product_structure * _section_space_schema_product
The product structure of the section space schema id space.
Abstract base class with useful features for all objects.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
section_space_schema_jims_index_space_iterator()
Default constructor.
virtual bool invariant() const
Class invariant.
virtual bool conforms_to_state(explicit_index_space_state *xstate) const
True if this conforms to the iterator type required by the explicit id space state xstate...
index_space_iterator * _base_space_itr
The base space jims id space iterator.
const index_space_handle & base_space() const
The base space jims id space.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
virtual ~section_space_schema_jims_index_space_iterator()
Destructor.
virtual void next()
Makes item() the next id in the iteration.
section_space_schema_jims_index_space_state & state()
The explicit state (mutable version).
A 2D implementation of abstract_product_structure.
virtual bool invariant() const
Class invariant.
An implementation class explicit_index_space_state for the jims id space of the section space schema...
void update_ids()
Update the ids.
virtual section_space_schema_jims_index_space_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this. If the iterator is attached...
Factory and container for a family of id spaces.
An iterator over an id space in which the equivalence between the ids in the space and the hub id spa...
pod_index_type pod_type
The "plain old data" index type for this.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
index_space_iterator & fiber_schema_iterator()
The fiber schema jims id space iterator.
Namespace for the fiber_bundles component of the sheaf system.
virtual index_space_iterator * clone() const =0
Virtual constructor, makes a new instance of the same type as this. If the iterator is attached...
virtual bool is_attached() const
True if this iterator is attached to a state.
section_space_schema_jims_index_space_iterator & operator=(const section_space_schema_jims_index_space_iterator &xother)
Assignment operator.
const index_space_handle & fiber_schema() const
The fiber schema jims id space.