File index_vector_complete.hpp

class CompleteIndexVector : public IIndexVector
#include <index_vector_complete.hpp>

Provides random access to all indices within a continuous range [0, numIndices).

Public Types

using const_iterator = IndexIterator

An iterator that provides read-only access to the indices in the vector.

Public Functions

CompleteIndexVector(uint32 numElements)
Parameters:

numElements – The number of indices, the vector provides access to

const_iterator cbegin() const

Returns a const_iterator to the beginning of the indices.

Returns:

A const_iterator to the beginning

const_iterator cend() const

Returns a const_iterator to the end of the indices.

Returns:

A const_iterator to the end

void setNumElements(uint32 numElements, bool freeMemory)

Sets the number of indices.

Parameters:
  • numElements – The number of indices to be set

  • freeMemory – True, if unused memory should be freed, if possible, false otherwise

virtual uint32 getNumElements() const override

Returns the number of indices.

Returns:

The number of indices

virtual bool isPartial() const override

Returns whether the indices are partial, i.e., some indices in the range [0, getNumElements()) are missing, or not.

Returns:

True, if the indices are partial, false otherwise

virtual uint32 getIndex(uint32 pos) const override

Returns the index at a specific position.

Parameters:

pos – The position of the index. Must be in [0, getNumElements())

Returns:

The index at the given position

virtual void visit(PartialIndexVectorVisitor partialIndexVectorVisitor, CompleteIndexVectorVisitor completeIndexVectorVisitor) const override

Invokes one of the given visitor functions, depending on which one is able to handle this particular type of vector.

Parameters:
  • partialIndexVectorVisitor – The visitor function for handling objects of the type PartialIndexVector

  • completeIndexVectorVisitor – The visitor function for handling objects of the type CompleteIndexVector

Private Members

uint32 numElements_