File view.hpp¶
Typedefs
-
template<typename T>
class View¶ - #include <view.hpp>
A view that provides access to values stored in a pre-allocated array.
- Template Parameters:
T – The type of the values, the view provides access to
Subclassed by Allocator< View >, ClearableViewDecorator< View >, IndexableViewDecorator< View >, Vector< T >
Public Types
-
typedef const value_type *const_iterator¶
An iterator that provides read-only access to the elements in the view.
-
typedef value_type *iterator¶
An iterator that provides access to the elements in the view and allows to modify them.
Public Functions
-
inline View(T *array, std::initializer_list<uint32> dimensions)¶
- Parameters:
array – A pointer to an array of template type
T
that stores the values, the view should provide access todimensions – The number of elements in each dimension of the view
-
inline View(T *array)¶
- Parameters:
array – A pointer to an array of template type
T
that stores the values, the view should provide access to
-
inline View(const View<T> &other)¶
- Parameters:
other – A const reference to an object of type
View
that should be copied
-
inline View(View<T> &&other)¶
- Parameters:
other – A reference to an object of type
View
that should be moved
-
inline virtual ~View()¶
-
inline value_type *release()¶
Releases the ownership of the array that stores the values, the view provides access to. As a result, the behavior of this view becomes undefined and it should not be used anymore. The caller is responsible for freeing the memory that is occupied by the array.
- Returns:
A pointer to the array that stores the values, the view provided access to
-
inline const_iterator cbegin() const¶
Returns a
const_iterator
to the beginning of the view.- Returns:
A
const_iterator
to the beginning
-
inline iterator begin()¶
Returns an
iterator
to the beginning of the view.- Returns:
An
iterator
to the beginning
-
inline const value_type &operator[](uint32 pos) const¶
Returns a const reference to the element at a specific position.
- Parameters:
pos – The position of the element
- Returns:
A const reference to the specified element
-
inline value_type &operator[](uint32 pos)¶
Returns a reference to the element at a specific position.
- Parameters:
pos – The position of the element
- Returns:
A reference to the specified element
-
template<typename View>
class Allocator : public View<T>¶ - #include <view.hpp>
Allocates the memory, a view provides access to.
- Template Parameters:
View – The type of the view
Subclassed by ResizableAllocator< View >
Public Functions
-
inline Allocator(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
-
inline Allocator(const Allocator<View> &other)¶
- Parameters:
other – A reference to an object of type
Allocator
that should be copied
-
inline Allocator(Allocator<View> &&other)¶
- Parameters:
other – A reference to an object of type
Allocator
that should be moved
-
inline virtual ~Allocator() override¶
-
template<typename View>
class ResizableAllocator : public Allocator<View>¶ - #include <view.hpp>
Allocates the memory, a view provides access to, and allows to resize it afterwards.
- Template Parameters:
View – The type of the view
Public Functions
-
inline 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
-
inline ResizableAllocator(const ResizableAllocator<View> &other)¶
- Parameters:
other – A reference to an object of type
ResizableAllocator
that should be copied
-
inline ResizableAllocator(ResizableAllocator<View> &&other)¶
- Parameters:
other – A reference to an object of type
ResizableAllocator
that should be moved
-
inline virtual ~ResizableAllocator() override¶
-
template<typename View>
class ViewDecorator¶ - #include <view.hpp>
A base class for all data structures that are backed by a view.
- Template Parameters:
View – The type of the view, the data structure is backed by
Subclassed by BinnedVectorDecorator< ViewDecorator< CompositeVector< AllocatedVector< uint32 >, ResizableVector< float64 > > > >, IterableListOfListsDecorator< ViewDecorator< AllocatedListOfLists< Tuple< float64 > > > >, VectorDecorator< AllocatedVector< float64 > >, VectorDecorator< AllocatedVector< uint32 > >, MatrixDecorator< View >, VectorDecorator< View >
Public Functions
-
inline ViewDecorator(View &&view)¶
- Parameters:
view – The view, the data structure should be backed by
-
inline virtual ~ViewDecorator()¶
-
template<typename View>
class IndexableViewDecorator : public View<T>¶ - #include <view.hpp>
Provides random access to the values stored in a view.
- Template Parameters:
View – The type of the view
Subclassed by Array< T >
Public Types
Public Functions
-
inline IndexableViewDecorator(typename View::view_type &&view)¶
- Parameters:
view – The view, the view should be backed by
-
inline virtual ~IndexableViewDecorator() override¶
-
inline const_iterator cbegin() const¶
Returns a
const_iterator
to the beginning of the view.- Returns:
A
const_iterator
to the beginning
-
inline iterator begin()¶
Returns an
iterator
to the beginning of the view.- Returns:
An
iterator
to the beginning