File view_vector.hpp¶
Typedefs
-
template<typename T, typename MemoryAllocator = DefaultMemoryAllocator>
using AllocatedVector = Allocator<Vector<T>, MemoryAllocator>¶ Allocates the memory, a
Vectorprovides access to.- Template Parameters:
T – The type of the values stored in the
VectorMemoryAllocator – The type of the memory allocator to be used
-
template<typename T, typename MemoryAllocator = DefaultMemoryAllocator>
using ResizableVector = ResizableAllocator<Vector<T>, MemoryAllocator>¶ Allocates the memory, a
Vectorprovides access to, and allows to resize it afterwards.- Template Parameters:
T – The type of the values stored in the
VectorMemoryAllocator – The type of the memory allocator to be used
-
template<typename T>
class Vector : public View<T>¶ - #include <view_vector.hpp>
A one-dimensional view that provides access to values stored in a pre-allocated array of a specific size.
- Template Parameters:
T – The type of the values, the view provides access to
Subclassed by Allocator< Vector< T >, MemoryAllocator >, IndexableViewDecorator< Vector >, BinaryDokVectorAllocator< Vector >, IterableIndexedVectorDecorator< Vector >, ListOfLists< T >::Row, ResizableVectorDecorator< Vector >
Public Functions
-
inline Vector(T *array, uint32 numElements, uint32 padding = 0)¶
- Parameters:
array – A pointer to an array of template type
Tthat stores the values, the view should provide access tonumElements – The number of elements in the view
padding – The number of elements added to the vector to ensure aligned memory access when using SIMD operations
-
inline Vector(const Vector<T> &other)¶
- Parameters:
other – A const reference to an object of type
Vectorthat should be copied
-
inline Vector(Vector<T> &&other)¶
- Parameters:
other – A reference to an object of type
Vectorthat should be moved
-
inline virtual ~Vector() override¶
-
inline View<T>::const_iterator cend() const¶
Returns a
const_iteratorto the end of the vector.- Returns:
A
const_iteratorto the end
-
inline View<T>::iterator end()¶
Returns an
iteratorto the end of the vector.- Returns:
An
iteratorto the end
-
inline void clear()¶
Sets all values stored in the view to zero.
Public Members
-
template<typename View, typename MemoryAllocator = DefaultMemoryAllocator>
class ResizableAllocator : public Allocator<View, DefaultMemoryAllocator>¶ - #include <view_vector.hpp>
Allocates the memory, a
Vectorprovides access to, and allows to resize it afterwards.- Template Parameters:
View – The type of the view
MemoryAllocator – The type of the memory allocator to be used
Public Functions
-
inline explicit ResizableAllocator(uint32 numElements, bool init = false)¶
- Parameters:
numElements – The number of elements in the view
init – True, if all elements in the view should be value-initialized, false otherwise
-
ResizableAllocator(const ResizableAllocator<View, MemoryAllocator> &other) = delete¶
- Parameters:
other – A reference to an object of type
ResizableAllocatorthat should be copied
-
inline ResizableAllocator(ResizableAllocator<View, MemoryAllocator> &&other)¶
- Parameters:
other – A reference to an object of type
ResizableAllocatorthat should be moved
-
inline virtual ~ResizableAllocator() override¶
-
template<typename View>
class VectorDecorator : public ViewDecorator<View>¶ - #include <view_vector.hpp>
A vector that is backed by a one-dimensional view of a specific size.
- Template Parameters:
View – The type of view, the vector is backed by
-
template<typename Vector>
class IterableVectorDecorator : public IndexableViewDecorator<Vector>¶ - #include <view_vector.hpp>
Provides access via iterators to the values stored in a vector.
- Template Parameters:
Vector – The type of the vector
Public Functions
-
inline explicit IterableVectorDecorator(typename Vector::view_type &&view)¶
- Parameters:
view – The view, the vector should be backed by
-
inline virtual ~IterableVectorDecorator() override¶
-
inline IndexableViewDecorator<Vector>::const_iterator cend() const¶
Returns a
const_iteratorto the end of the vector.- Returns:
A
const_iteratorto the end
-
inline IndexableViewDecorator<Vector>::iterator end()¶
Returns an
iteratorto the end of the vector.- Returns:
An
iteratorto the end
-
template<typename Vector>
class ResizableVectorDecorator : public Vector<T>¶ - #include <view_vector.hpp>
Allows to resize a vector.
- Template Parameters:
Vector – The type of the vector
Subclassed by ResizableDenseVector< IndexedValue< T >, MemoryAllocator >, ResizableDenseVector< uint32, MemoryAllocator >