HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_RTIElementGroup Class Reference

Iterate over a group of elements Iterate over a group of elements. If no group is specified, this is is an empty range. More...

#include <GA_RTIElementGroup.h>

+ Inheritance diagram for GA_RTIElementGroup:

Public Member Functions

 GA_RTIElementGroup (const GA_IndexMap &index_map, const char *name, bool complement, bool ignore_order)
 
 GA_RTIElementGroup (const GA_IndexMap &index_map, const GA_ElementGroup *group, bool complement, bool ignore_order)
 
 GA_RTIElementGroup (const GA_RTIElementGroup &i)
 Copy constructor. More...
 
 ~GA_RTIElementGroup () override
 Destructor. More...
 
void iterateRewind (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
 
void iterateNext (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
 
virtual GA_RangeTypeInterfacegetRemainder (const GA_IteratorState &state, const GA_Offset current) const
 
GA_RangeTypeInterfacecopy () const override
 
bool isSplittable () const override
 
bool isEmpty () const override
 
GA_Size getMaxEntries () const override
 
GA_Size getEntries () const override
 
bool split (GA_RangeTypeInterface *list[2]) const override
 
bool isEqual (const GA_RangeTypeInterface &src) const override
 
void iterateCopy (GA_IteratorState &dest, const GA_IteratorState &src) const override
 
bool isOrdered () const override
 
bool areTraversalDeletionsSafe () const override
 
bool canContainDuplicates () const override
 
const GA_RangeMemberQueryallocMemberQuery () const override
 
GA_Size getPageCount () const override
 
bool getPageElementRange (GA_Range &, GA_Size, GA_Size) const override
 
GA_Offset getFirstOffsetInPage (GA_Size) const override
 
- Public Member Functions inherited from GA_RTISingle
 GA_RTISingle (const GA_IndexMap &list)
 
 GA_RTISingle (const GA_RTISingle &other)
 
 ~GA_RTISingle () override
 
void iterateRewind (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
 
void iterateNext (GA_IteratorState &state, GA_Offset &start, GA_Offset &end) const override
 
- Public Member Functions inherited from GA_RangeTypeInterface
 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...
 
bool splitIntoRanges (GA_Range &r1, GA_Range &r2) const
 Split into two existing ranges. More...
 
const GA_IndexMapgetIndexMap () const
 Accessor for the index map. More...
 
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
 

Protected Member Functions

 GA_RTIElementGroup (const GA_ElementGroup &group, GA_Offset start, GA_Offset end, bool complement)
 Constructor used in splitting range. More...
 
void nextSpan (GA_IteratorState &state) const
 Move to the next span. More...
 
void incState (GA_IteratorState &state) const
 Move to the next offset in the current span. More...
 
bool ordered () const
 
void singleRewind (GA_IteratorState &state) const override
 
bool singleGet (const GA_IteratorState &state, GA_Offset &value) const override
 
void singleNext (GA_IteratorState &state) const override
 
- Protected Member Functions inherited from GA_RangeTypeInterface
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from GA_RangeTypeInterface
static voidoperator new (size_t size, void *p)
 
static voidoperator new (size_t size)
 
static void operator delete (void *p, size_t size)
 

Detailed Description

Iterate over a group of elements Iterate over a group of elements. If no group is specified, this is is an empty range.

There are some caveats when specifying the complement of a group:

  • The order of elements is undefined, even if the group is ordered
  • If there is no group specified, the range will be empty The first caveate may be expected, the second may be non-intuitive.
See Also
GA_RangeTypeInterface

Definition at line 39 of file GA_RTIElementGroup.h.

Constructor & Destructor Documentation

GA_RTIElementGroup::GA_RTIElementGroup ( const GA_IndexMap index_map,
const char *  name,
bool  complement,
bool  ignore_order 
)

Construct given a group name (may be NULL)

If complement is false, the range will be composed of elements in the group. If complement is true, the complement of the group will be contained in the range.

GA_RTIElementGroup::GA_RTIElementGroup ( const GA_IndexMap index_map,
const GA_ElementGroup group,
bool  complement,
bool  ignore_order 
)

Construct given an optional group (the group owner should match the index map owner)

GA_RTIElementGroup::GA_RTIElementGroup ( const GA_RTIElementGroup i)

Copy constructor.

GA_RTIElementGroup::~GA_RTIElementGroup ( )
override

Destructor.

GA_RTIElementGroup::GA_RTIElementGroup ( const GA_ElementGroup group,
GA_Offset  start,
GA_Offset  end,
bool  complement 
)
protected

Constructor used in splitting range.

Member Function Documentation

const GA_RangeMemberQuery* GA_RTIElementGroup::allocMemberQuery ( ) const
overridevirtual

RangeTypeInterface implementation

Reimplemented from GA_RangeTypeInterface.

bool GA_RTIElementGroup::areTraversalDeletionsSafe ( ) const
overridevirtual

RangeTypeInterface implementation

Reimplemented from GA_RangeTypeInterface.

bool GA_RTIElementGroup::canContainDuplicates ( ) const
inlineoverridevirtual

RangeTypeInterface implementation

Reimplemented from GA_RangeTypeInterface.

Definition at line 78 of file GA_RTIElementGroup.h.

GA_RangeTypeInterface* GA_RTIElementGroup::copy ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

GA_Size GA_RTIElementGroup::getEntries ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

GA_Offset GA_RTIElementGroup::getFirstOffsetInPage ( GA_Size  ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

GA_Size GA_RTIElementGroup::getMaxEntries ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

GA_Size GA_RTIElementGroup::getPageCount ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

bool GA_RTIElementGroup::getPageElementRange ( GA_Range ,
GA_Size  ,
GA_Size   
) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

virtual GA_RangeTypeInterface* GA_RTIElementGroup::getRemainder ( const GA_IteratorState state,
const GA_Offset  current 
) const
virtual

Get a GA_RangeTypeInterface representing the remainder of the range after iterating over part of it, as specified by state and current. NOTE: The caller is responsible for deleting the returned GA_RangeTypeInterface!

void GA_RTIElementGroup::incState ( GA_IteratorState state) const
protected

Move to the next offset in the current span.

bool GA_RTIElementGroup::isEmpty ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

bool GA_RTIElementGroup::isEqual ( const GA_RangeTypeInterface src) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

bool GA_RTIElementGroup::isOrdered ( ) const
overridevirtual

RangeTypeInterface implementation

Reimplemented from GA_RangeTypeInterface.

bool GA_RTIElementGroup::isSplittable ( ) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

void GA_RTIElementGroup::iterateCopy ( GA_IteratorState dest,
const GA_IteratorState src 
) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.

void GA_RTIElementGroup::iterateNext ( GA_IteratorState state,
GA_Offset start,
GA_Offset end 
) const
overridevirtual

Choose the next contiguous range. If the iteration is complete, start should be set to a value greater than end.

Implements GA_RangeTypeInterface.

void GA_RTIElementGroup::iterateRewind ( GA_IteratorState state,
GA_Offset start,
GA_Offset end 
) const
overridevirtual

We partially override these iterates. We pass down to the RTISingle for ordered groups, but unordered groups we can do a fast path. 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

Implements GA_RangeTypeInterface.

void GA_RTIElementGroup::nextSpan ( GA_IteratorState state) const
protected

Move to the next span.

bool GA_RTIElementGroup::ordered ( ) const
inlineprotected

Test if the group is ordered. When the range specifies the complement of the group, there can be no order.

Definition at line 131 of file GA_RTIElementGroup.h.

bool GA_RTIElementGroup::singleGet ( const GA_IteratorState state,
GA_Offset value 
) const
overrideprotectedvirtual

RangeTypeInterface implementation

Implements GA_RTISingle.

void GA_RTIElementGroup::singleNext ( GA_IteratorState state) const
overrideprotectedvirtual

RangeTypeInterface implementation

Implements GA_RTISingle.

void GA_RTIElementGroup::singleRewind ( GA_IteratorState state) const
overrideprotectedvirtual

RangeTypeInterface implementation

Implements GA_RTISingle.

bool GA_RTIElementGroup::split ( GA_RangeTypeInterface list[2]) const
overridevirtual

RangeTypeInterface implementation

Implements GA_RangeTypeInterface.


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