![]() |
VISR
0.11.7
Versatile Interactive Scene Renderer
|
#include <basic_vector.hpp>
Public Member Functions | |
BasicVector (std::size_t alignmentElements=0) | |
BasicVector (std::size_t size, std::size_t alignmentElements) | |
BasicVector (std::initializer_list< ElementType > const &initialValues, std::size_t alignmentElements=0) | |
BasicVector (BasicVector< ElementType > &&rhs)=default | |
BasicVector< ElementType > & | operator= (BasicVector< ElementType > &&rhs)=default |
~BasicVector () | |
void | resize (std::size_t newSize) |
void | assign (const BasicVector< ElementType > &rhs) |
void | zeroFill () |
void | fillValue (ElementType val) |
void | swap (BasicVector< ElementType > &rhs) |
void | copy (BasicVector< ElementType > const &rhs) |
std::size_t | alignmentElements () const |
std::size_t | size () const |
ElementType & | operator[] (std::size_t idx) |
ElementType const & | operator[] (std::size_t idx) const |
ElementType & | at (std::size_t idx) |
ElementType const & | at (std::size_t idx) const |
ElementType * | data () |
ElementType const * | data () const |
Basic numeric vector type with comprehensive access functions, but little arithmetic functionality. Such functions should be added as free functions (probably as wrappers around the vector functions implemented in libefl
|
inlineexplicit |
Construct an empty vector.
alignmentElements | The alignment of the array, given as a multiple of the element size. |
|
inlineexplicit |
Construct a vector with a given size. The elements are initialized to the zero element of the vector's data type.
size | The number of elements. |
alignmentElements | The alignment of the array, given as a multiple of the element size. |
|
inlineexplicit |
Construct a vector from a static initialiser list. This constructor is mainly used to initialise a vector from a values represented in the source code. The size of the vector is determined from the number of elements in initialValues
.
initialValues | The vector elements represented by a list in curly braces. |
alignmentElements | The alignment of the array, given as a multiple of the element size. |
|
default |
|
inline |
Destructor.
|
inline |
Query the alignment of the vector data as specified in the constructor.
|
inline |
Explicit assignment function. Resizes the vector to the size of rhs
and copies the content.
rhs | Vector to be copied. |
|
inline |
Index access to an element of the array. This version returns a non-const reference that can be used to alter the value.
idx | A zero-offset vector index. |
idx
std::out_of_range | If idx exceeds the size of the vector. |
|
inline |
Index access to an element of the array. This const version returns a non-const reference.
idx | A zero-offset vector index. |
idx
std::out_of_range | If idx exceeds the size of the vector. |
|
inline |
Copy the content of Vector.
rhs | The Vector to be copied. |
std::invalid_argument | if the size of rhs does not match this Vector. |
|
inline |
Gain access to the vector's raw data.
|
inline |
Gain access to the vector's raw data (const version)
|
inline |
Set all elements of the vector to the same value.
val | The new value of all vector elements. |
std::runtime_error | If an arithmetic error occurs. |
|
default |
|
inline |
Index access to an element of the array. This version returns a non-const reference that can be used to alter the value.
idx | A zero-offset vector index. |
idx
|
inline |
Index access to an element of the array. This is the const version which returns a const reference,
idx | A zero-offset vector index. |
idx
|
inline |
Reset the size of the vector. All elements will be reset to zero.
newSize | The new size (in elements) |
|
inline |
Query the size of the vector.
|
inline |
Swap the contents with a vector of a consistent layout.
rhs | The Vector to be swapped with. |
std::logic_error | if the vector layouts, i.e., number of rows or columns, stride or alignment, are inconsistent. |
|
inline |
Set the vector elements to the zero element of the data type template parameter.
std::runtime_error | If an arithmetic error occurs. |