Iterate over the blocks of EntityHandles in an Range that are in the same EntitySequence. More...
#include <RangeSeqIntersectIter.hpp>
Public Member Functions | |
RangeSeqIntersectIter (SequenceManager *sequences) | |
ErrorCode | init (Range::const_iterator start, Range::const_iterator end) |
ErrorCode | step () |
bool | is_at_end () const |
Check if next call to step() will return MB_FAILURE. More... | |
EntitySequence * | get_sequence () const |
EntityHandle | get_start_handle () const |
EntityHandle | get_end_handle () const |
Private Member Functions | |
ErrorCode | update_entity_sequence () |
ErrorCode | find_invalid_range () |
Private Attributes | |
SequenceManager * | mSequenceManager |
THE EntitySequenceManager. More... | |
EntitySequence * | mSequence |
EntitySequence corresponding to current location. More... | |
Range::const_pair_iterator | rangeIter |
Current position in Range. More... | |
EntityHandle | mStartHandle |
EntityHandle | mEndHandle |
Subset of current EntitySequence. More... | |
EntityHandle | mLastHandle |
The last of the list of all handles in the Range. More... | |
Iterate over the blocks of EntityHandles in an Range that are in the same EntitySequence.
Iterate over an Range, returning blocks of entities that are the largest ranges of contiguous handles that meet one of the following conditions:
The return type from init() or step() indicates whether or not the current range contains valid entities. If the handles are either all valid or all holes in an EntitySequence, that sequence can be obtained with get_sequence(). get_sequence() will return NULL if there is no corresponding EntitySequence for the block of handles.
This class keeps a data related to the 'current' EntitySequence and references to the Range pasesd to init(). Changing either of these while an instance of this class is in use would be bad.
Definition at line 55 of file RangeSeqIntersectIter.hpp.
|
inline |
Definition at line 58 of file RangeSeqIntersectIter.hpp.
|
private |
Handle error case where we encountered an EntityHandle w/out a corresponding EntitySequence. Trim mEndHandle such that it is before the next valid EntityHandle of the same type.
Definition at line 112 of file RangeSeqIntersectIter.cpp.
References moab::CREATE_HANDLE(), moab::TypeSequenceManager::end(), moab::SequenceManager::entity_map(), MB_END_ID, MB_ENTITY_NOT_FOUND, mEndHandle, mSequence, mSequenceManager, mStartHandle, moab::TYPE_FROM_HANDLE(), and moab::TypeSequenceManager::upper_bound().
Referenced by update_entity_sequence().
|
inline |
Get last handle in block
Definition at line 105 of file RangeSeqIntersectIter.hpp.
References mEndHandle.
Referenced by moab::WriteUtil::gather_nodes_from_elements(), moab::WriteUtil::get_entity_list_pointers(), moab::AEntityFactory::get_memory_use(), moab::get_tagged(), moab::WriteDamsel::write_entities(), moab::WriteDamsel::write_sets(), and moab::WriteDamsel::write_vertices().
|
inline |
Get the EntitySequence for the current block. May be NULL for invaild handles.
Definition at line 93 of file RangeSeqIntersectIter.hpp.
References mSequence.
Referenced by moab::WriteUtil::gather_nodes_from_elements(), moab::WriteUtil::get_entity_list_pointers(), moab::AEntityFactory::get_memory_use(), moab::get_tagged(), moab::WriteDamsel::map_dense_tags(), and moab::WriteDamsel::write_entities().
|
inline |
Get first handle in block
Definition at line 99 of file RangeSeqIntersectIter.hpp.
References mStartHandle.
Referenced by moab::WriteUtil::gather_nodes_from_elements(), moab::WriteUtil::get_entity_list_pointers(), moab::AEntityFactory::get_memory_use(), moab::get_tagged(), moab::WriteDamsel::map_dense_tags(), moab::WriteDamsel::write_entities(), moab::WriteDamsel::write_sets(), moab::WriteDamsel::write_subrange(), and moab::WriteDamsel::write_vertices().
ErrorCode moab::RangeSeqIntersectIter::init | ( | Range::const_iterator | start, |
Range::const_iterator | end | ||
) |
Initialize iterator to first valid subset
Definition at line 29 of file RangeSeqIntersectIter.cpp.
References ErrorCode, mEndHandle, mLastHandle, mSequence, mStartHandle, rangeIter, and update_entity_sequence().
Referenced by moab::WriteUtil::gather_nodes_from_elements(), moab::WriteUtil::get_entity_list_pointers(), moab::AEntityFactory::get_memory_use(), moab::get_tagged(), and moab::WriteDamsel::write_file().
|
inline |
Check if next call to step() will return MB_FAILURE.
Check if the iterator cannot be advanced any further. If this method returns true, then the next call to step() will return MB_FAILURE.
Definition at line 85 of file RangeSeqIntersectIter.hpp.
References mEndHandle, and mLastHandle.
Referenced by step().
ErrorCode moab::RangeSeqIntersectIter::step | ( | ) |
Step iterator to next range.
Definition at line 57 of file RangeSeqIntersectIter.cpp.
References ErrorCode, is_at_end(), mEndHandle, mLastHandle, mStartHandle, rangeIter, and update_entity_sequence().
Referenced by moab::WriteUtil::gather_nodes_from_elements(), moab::WriteUtil::get_entity_list_pointers(), moab::AEntityFactory::get_memory_use(), moab::get_tagged(), and moab::WriteDamsel::write_file().
|
private |
Update entity sequence data (mSequence and freeIndex) for current mStartHandle. If mEndHandle is past end of sequence, trim it. Called by step() and init(). step() handles iterating over the pairs in the Range. This method handles iterating over the set of EntitySequences that intersect the pair.
Definition at line 89 of file RangeSeqIntersectIter.cpp.
References moab::EntitySequence::end_handle(), moab::SequenceManager::find(), find_invalid_range(), MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, MBMAXTYPE, mEndHandle, mSequence, mSequenceManager, mStartHandle, and moab::TYPE_FROM_HANDLE().
|
private |
Subset of current EntitySequence.
Definition at line 136 of file RangeSeqIntersectIter.hpp.
Referenced by find_invalid_range(), get_end_handle(), init(), is_at_end(), step(), and update_entity_sequence().
|
private |
The last of the list of all handles in the Range.
Definition at line 137 of file RangeSeqIntersectIter.hpp.
Referenced by init(), is_at_end(), and step().
|
private |
EntitySequence corresponding to current location.
Definition at line 134 of file RangeSeqIntersectIter.hpp.
Referenced by find_invalid_range(), get_sequence(), init(), and update_entity_sequence().
|
private |
THE EntitySequenceManager.
Definition at line 133 of file RangeSeqIntersectIter.hpp.
Referenced by find_invalid_range(), and update_entity_sequence().
|
private |
Definition at line 136 of file RangeSeqIntersectIter.hpp.
Referenced by find_invalid_range(), get_start_handle(), init(), step(), and update_entity_sequence().
|
private |
Current position in Range.
Definition at line 135 of file RangeSeqIntersectIter.hpp.