HDK
|
Abstract implementation of a range. More...
#include <GA_RangeTypeInterface.h>
Public Member Functions | |
GA_RangeTypeInterface (const GA_IndexMap &list) | |
GA_RangeTypeInterface (const GA_RangeTypeInterface &other) | |
virtual | ~GA_RangeTypeInterface () |
GA_AttributeOwner | getOwner () const |
Query type of element. More... | |
bool | is_divisible () const |
Convenience method to test whether the range is divisible. More... | |
virtual GA_RangeTypeInterface * | copy () const =0 |
Method to create a copy of this selection. More... | |
bool | splitIntoRanges (GA_Range &r1, GA_Range &r2) const |
Split into two existing ranges. More... | |
virtual bool | split (GA_RangeTypeInterface *list[2]) const =0 |
virtual bool | isSplittable () const =0 |
virtual GA_Size | getPageCount () const =0 |
For splittable ranges, return the number of pages contained in the range. More... | |
virtual bool | getPageElementRange (GA_Range &range, GA_Size relative_page, GA_Size npages=1) const =0 |
virtual GA_Offset | getFirstOffsetInPage (GA_Size relative_page) const =0 |
virtual bool | isEmpty () const =0 |
Check whether the range is empty. More... | |
virtual GA_Size | getMaxEntries () const =0 |
Get an upper bound on the size of the range. More... | |
virtual GA_Size | getEntries () const =0 |
virtual void | iterateCopy (GA_IteratorState &dest, const GA_IteratorState &src) const =0 |
Copy iterator state. The dest state will not have been constructed. More... | |
virtual void | iterateRewind (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const =0 |
virtual void | iterateNext (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const =0 |
virtual bool | isOrdered () const |
Query if the RTI is ordered according to the index. More... | |
virtual bool | areTraversalDeletionsSafe () const |
virtual bool | canContainDuplicates () const |
virtual const GA_RangeMemberQuery * | allocMemberQuery () const |
const GA_IndexMap & | getIndexMap () const |
Accessor for the index map. More... | |
virtual bool | isEqual (const GA_RangeTypeInterface &src) const =0 |
bool | operator== (const GA_RangeTypeInterface &src) const |
virtual void | iterateCreate (GA_IteratorState &state) const |
virtual void | iterateDestroy (GA_IteratorState &state) const |
void | incref () const |
void | decref () const |
Static Public Member Functions | |
static void * | operator new (size_t size, void *p) |
static void * | operator new (size_t size) |
static void | operator delete (void *p, size_t size) |
Protected Member Functions | |
bool | getPageElementRangeNonSplittable () const |
Method which can be called for getPageElementRange() More... | |
GA_Offset | getFirstOffsetInPageNonSplittable () const |
Method which can be called for getFirstOffsetInPage() More... | |
GA_Size | computeEntries () const |
This method creates an iterator and counts the entries. More... | |
Abstract implementation of a range.
A range specifies a selection/collection of elements in an index map. The range also provides an iterator over its elements.
With operation on ranges, the user may want to parallelize operations on the range. This is done by splitting the range into multiple new range. Not all ranges can be split.
Definition at line 40 of file GA_RangeTypeInterface.h.
GA_RangeTypeInterface::GA_RangeTypeInterface | ( | const GA_IndexMap & | list | ) |
GA_RangeTypeInterface::GA_RangeTypeInterface | ( | const GA_RangeTypeInterface & | other | ) |
|
virtual |
|
virtual |
Allocate an object to allow us to query whether individual elements are traversed by this range implementation. The responsibility for deleting the resulting object lies with the caller.
The default implementation will work for all derived classes, but more efficient implementations are often possible.
Reimplemented in GA_RTIElementGroup, and GA_RTIOffset_T< IncludeTemporaries >.
|
virtual |
Query if it is safe to delete an element during traversal. The method defaults to false.
Reimplemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveComprehension, GA_RTIPointComprehension, GA_RTIPageList, GA_RTINull, GA_RTICachedRange, GA_RTIOrderedRange, GA_RTIOffsetList, and GA_RTIRepeater.
|
inlinevirtual |
Query if the RTI contains duplicates. If it cannot, then optimizations can be made assuming that there are no duplicates in the range. This defaults to true.
Reimplemented in GA_RTIElementGroup, GA_RTIIndex, and GA_RTIOffset_T< IncludeTemporaries >.
Definition at line 168 of file GA_RangeTypeInterface.h.
|
protected |
This method creates an iterator and counts the entries.
|
pure virtual |
Method to create a copy of this selection.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
|
pure virtual |
Get an exact count of the size of the range
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
|
pure virtual |
If a page is splittable, this method must return the first offset in the given page. The relative_page
passed in will be between 0 and getPageCount()
and should be considered a relative page in the range. For non-splittable ranges, you can implement the method using
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveComprehension, GA_RTIPointComprehension, GA_RTIPageList, GA_RTICachedRange, GA_RTIPrimitiveRef, GA_RTINull, GA_RTIOrderedRange, GA_RTIOffsetList, and GA_RTIRepeater.
|
protected |
Method which can be called for getFirstOffsetInPage()
|
inline |
Accessor for the index map.
Definition at line 179 of file GA_RangeTypeInterface.h.
|
pure virtual |
Get an upper bound on the size of the range.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
GA_AttributeOwner GA_RangeTypeInterface::getOwner | ( | ) | const |
Query type of element.
|
pure virtual |
For splittable ranges, return the number of pages contained in the range.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveComprehension, GA_RTIPointComprehension, GA_RTIPageList, GA_RTIPrimitiveRef, GA_RTICachedRange, GA_RTINull, GA_RTIOrderedRange, GA_RTIOffsetList, and GA_RTIRepeater.
|
pure virtual |
If a page is splittable, this method returns an iterator for the elements in a set of npages
pages. The relative_page
passed in will be between 0 and getPageCount()
and should be considered a relative page in the range. For non-splittable ranges, you can implement the method using
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveComprehension, GA_RTIPointComprehension, GA_RTIPageList, GA_RTIPrimitiveRef, GA_RTICachedRange, GA_RTINull, GA_RTIOrderedRange, GA_RTIOffsetList, and GA_RTIRepeater.
|
protected |
Method which can be called for getPageElementRange()
|
inline |
Convenience method to test whether the range is divisible.
Definition at line 51 of file GA_RangeTypeInterface.h.
|
pure virtual |
Check whether the range is empty.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
|
pure virtual |
Compare two ranges
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
|
virtual |
Query if the RTI is ordered according to the index.
Reimplemented in GA_RTIElementGroup, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTINull, GA_RTICachedRange, and GA_RTIOrderedRange.
|
pure virtual |
Return whether the RTI is capable of splitting. If this method returns true, the range should be able to:
For a range to be splittable, you need to implement the following four methods:
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.
|
pure virtual |
Copy iterator state. The dest state will not have been constructed.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTICachedRange, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTINull, and GA_RTIRepeater.
|
inlinevirtual |
Construct/destruct the iterator state.
Reimplemented in GA_RTIFiltered.
Definition at line 130 of file GA_RangeTypeInterface.h.
|
inlinevirtual |
Construct/destruct the iterator state.
Reimplemented in GA_RTIFiltered, and GA_RTIPrimitiveRef.
Definition at line 131 of file GA_RangeTypeInterface.h.
|
pure virtual |
Choose the next contiguous range. If the iteration is complete, start
should be set to a value greater than end
. No "block" is allowed to cross a page boundary.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIOffsetList, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPageList, GA_RTINull, GA_RTIRepeater, and GA_RTISingle.
|
pure virtual |
Rewind the iterator (i.e. reset the iterator state). The start/offset should be initialized so that they define the first contiguous "block" for iteration. If the range is empty, start
should be greater than end
. No "block" is allowed to cross a page boundary.
The semantics are that start
is in the range and is one larger than the last element in the range. For example,
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIOffsetList, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPageList, GA_RTINull, GA_RTIRepeater, and GA_RTISingle.
Memory tracking for RTI's
Memory tracking for RTI's
Definition at line 191 of file GA_RangeTypeInterface.h.
|
static |
Memory tracking for RTI's
|
inline |
Compare two ranges
Definition at line 114 of file GA_RangeTypeInterface.h.
|
pure virtual |
Split the range into 2 separate ranges.
Implemented in GA_RTIFiltered, GA_RTIElementGroup, GA_RTIPointRef, GA_RTIPrimitiveComprehension, GA_RTIIndex, GA_RTIPointComprehension, GA_RTIOffset_T< IncludeTemporaries >, GA_RTINull, GA_RTIPrimitiveRef, GA_RTIPageList, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, and GA_RTIRepeater.
Split into two existing ranges.