HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RangeTypeInterface Class Referenceabstract

Abstract implementation of a range. More...

#include <GA_RangeTypeInterface.h>

+ Inheritance diagram for GA_RangeTypeInterface:

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_RangeTypeInterfacecopy () 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_RangeMemberQueryallocMemberQuery () const
 
const GA_IndexMapgetIndexMap () 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 voidoperator new (size_t size, void *p)
 
static voidoperator 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...
 

Detailed Description

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.

See Also
GA_Range

Definition at line 40 of file GA_RangeTypeInterface.h.

Constructor & Destructor Documentation

GA_RangeTypeInterface::GA_RangeTypeInterface ( const GA_IndexMap list)
GA_RangeTypeInterface::GA_RangeTypeInterface ( const GA_RangeTypeInterface other)
virtual GA_RangeTypeInterface::~GA_RangeTypeInterface ( )
virtual

Member Function Documentation

virtual const GA_RangeMemberQuery* GA_RangeTypeInterface::allocMemberQuery ( ) const
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 bool GA_RangeTypeInterface::areTraversalDeletionsSafe ( ) const
virtual
virtual bool GA_RangeTypeInterface::canContainDuplicates ( ) const
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.

GA_Size GA_RangeTypeInterface::computeEntries ( ) const
protected

This method creates an iterator and counts the entries.

void GA_RangeTypeInterface::decref ( ) const

Reference tracking for RTI's, necessary for GA_Range.

virtual GA_Offset GA_RangeTypeInterface::getFirstOffsetInPage ( GA_Size  relative_page) const
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_RTIPrimitiveRef, GA_RTINull, GA_RTICachedRange, GA_RTIOrderedRange, GA_RTIOffsetList, GA_RTIRepeater, and POP_RTIParticlePoints.

GA_Offset GA_RangeTypeInterface::getFirstOffsetInPageNonSplittable ( ) const
protected

Method which can be called for getFirstOffsetInPage()

const GA_IndexMap& GA_RangeTypeInterface::getIndexMap ( ) const
inline

Accessor for the index map.

Definition at line 179 of file GA_RangeTypeInterface.h.

GA_AttributeOwner GA_RangeTypeInterface::getOwner ( ) const

Query type of element.

virtual GA_Size GA_RangeTypeInterface::getPageCount ( ) const
pure virtual
virtual bool GA_RangeTypeInterface::getPageElementRange ( GA_Range range,
GA_Size  relative_page,
GA_Size  npages = 1 
) const
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_RTINull, GA_RTICachedRange, GA_RTIOrderedRange, GA_RTIOffsetList, GA_RTIRepeater, and POP_RTIParticlePoints.

bool GA_RangeTypeInterface::getPageElementRangeNonSplittable ( ) const
protected

Method which can be called for getPageElementRange()

void GA_RangeTypeInterface::incref ( ) const

Reference tracking for RTI's, necessary for GA_Range.

bool GA_RangeTypeInterface::is_divisible ( ) const
inline

Convenience method to test whether the range is divisible.

Definition at line 51 of file GA_RangeTypeInterface.h.

virtual bool GA_RangeTypeInterface::isOrdered ( ) const
virtual

Query if the RTI is ordered according to the index.

Reimplemented in GA_RTIElementGroup, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTINull, GA_RTIOrderedRange, and GA_RTICachedRange.

virtual bool GA_RangeTypeInterface::isSplittable ( ) const
pure virtual

Return whether the RTI is capable of splitting. If this method returns true, the range should be able to:

  • Perform a binary split into two ranges if there are more than one page of data in the range.
  • Create an iterator which will iterate over the elements in a given range of pages.

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, POP_RTIParticlePoints, GA_RTIOffsetList, GA_RTIOrderedRange, GA_RTICachedRange, GA_RTINull, and GA_RTIRepeater.

virtual void GA_RangeTypeInterface::iterateCreate ( GA_IteratorState state) const
inlinevirtual

Construct/destruct the iterator state.

Reimplemented in POP_RTIParticlePoints, and GA_RTIFiltered.

Definition at line 130 of file GA_RangeTypeInterface.h.

virtual void GA_RangeTypeInterface::iterateDestroy ( GA_IteratorState state) const
inlinevirtual

Construct/destruct the iterator state.

Reimplemented in POP_RTIParticlePoints, GA_RTIFiltered, and GA_RTIPrimitiveRef.

Definition at line 131 of file GA_RangeTypeInterface.h.

virtual void GA_RangeTypeInterface::iterateNext ( GA_IteratorState state,
GA_Offset start,
GA_Offset end 
) const
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 POP_RTIParticlePoints, GA_RTIFiltered, GA_RTIElementGroup, GA_RTIOffsetList, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPageList, GA_RTINull, GA_RTIRepeater, and GA_RTISingle.

virtual void GA_RangeTypeInterface::iterateRewind ( GA_IteratorState state,
GA_Offset start,
GA_Offset end 
) const
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,

start := 6
end := 9
elements := [6, 7, 8]

Implemented in POP_RTIParticlePoints, GA_RTIFiltered, GA_RTIElementGroup, GA_RTIOffsetList, GA_RTIIndex, GA_RTIOffset_T< IncludeTemporaries >, GA_RTIPageList, GA_RTINull, GA_RTIRepeater, and GA_RTISingle.

static void GA_RangeTypeInterface::operator delete ( void p,
size_t  size 
)
static

Memory tracking for RTI's

static void* GA_RangeTypeInterface::operator new ( size_t  size,
void p 
)
inlinestatic

Memory tracking for RTI's

Definition at line 191 of file GA_RangeTypeInterface.h.

static void* GA_RangeTypeInterface::operator new ( size_t  size)
static

Memory tracking for RTI's

bool GA_RangeTypeInterface::operator== ( const GA_RangeTypeInterface src) const
inline

Compare two ranges

Definition at line 114 of file GA_RangeTypeInterface.h.

virtual bool GA_RangeTypeInterface::split ( GA_RangeTypeInterface list[2]) const
pure virtual

Split the range into 2 separate ranges.

Note
the split ranges must contain separate pages of offsets. That is a single page cannot be split.

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, POP_RTIParticlePoints, and GA_RTIRepeater.

bool GA_RangeTypeInterface::splitIntoRanges ( GA_Range r1,
GA_Range r2 
) const

Split into two existing ranges.


The documentation for this class was generated from the following file: