#include <DataContainer.h>
Mix ContiguousContainerMixin and VectorArithmeticMixin into a DataHolder as a user-defined derived class.
| TDerived | The derived class |
The class can be specialized for any container which implements the SizedData requirements.
Public Types | |
| using | Container = typename Holder::Container |
| The concrete container type. | |
| using | Holder = THolder |
| The concrete data holder type. | |
Public Types inherited from ContiguousContainerMixin< T, TDerived > | |
| using | const_iterator = const T * |
| The constant value iterator. | |
| using | const_reference = const T & |
| The constant value reference. | |
| using | difference_type = std::ptrdiff_t |
| The iterator difference type. | |
| using | iterator = T * |
| The value iterator. | |
| using | reference = T & |
| The value reference. | |
| using | size_type = std::size_t |
| The underlying container size type. | |
| using | value_type = T |
| The value type. | |
Public Member Functions | |
Construction | |
| template<typename TSize = std::size_t, typename std::enable_if_t< std::is_integral< TSize >::value, TSize > * = nullptr> | |
| DataContainer (TSize s=0, std::remove_const_t< T > *d=nullptr) | |
| Construct from a size and non-constant data. | |
| template<typename TSize = std::size_t, typename std::enable_if_t< std::is_integral< TSize >::value, TSize > * = nullptr> | |
| DataContainer (TSize s, const T *d) | |
| Construct from a size and constant data. | |
| template<typename TIterator > | |
| DataContainer (TIterator begin, TIterator end) | |
| Iterator-based constructor. | |
| DataContainer (std::initializer_list< T > values) | |
| Value list constructor. | |
| template<typename TArg0 , typename... TArgs, typename std::enable_if_t< not std::is_integral< TArg0 >::value, TArg0 > * = nullptr> | |
| DataContainer (TArg0 arg0, TArgs &&... args) | |
| Forwarding constructor. | |
Element access | |
| T * | data () |
| const std::decay_t< Container > & | container () const |
| Access the container in read-only mode. | |
Data modifiers | |
| Container & | moveTo (Container &destination) |
| Move the container. More... | |
Public Member Functions inherited from ContiguousContainerMixin< T, TDerived > | |
| bool | empty () const |
| Check whether the container is empty. More... | |
| const T & | operator[] (size_type index) const |
| Access the element with given index. | |
| T & | operator[] (size_type index) |
| Access the element with given index. | |
| const_iterator | begin () const |
| Iterator to the first element. | |
| iterator | begin () |
| Iterator to the first element. | |
| const_iterator | cbegin () |
| Iterator to the first element. | |
| const_iterator | end () const |
| Iterator to one past the last element. | |
| iterator | end () |
| Iterator to one past the last element. | |
| const_iterator | cend () |
| Iterator to one past the last element. | |
| virtual bool | operator== (const TDerived &rhs) const |
| Check equality. | |
| bool | operator!= (const TDerived &rhs) const |
| Check inequality. | |
Public Member Functions inherited from VectorArithmeticMixin< T, TDerived, Incrementable > | |
| TDerived & | operator+= (const TDerived &rhs) |
| V += U and W = V + U. | |
| TDerived & | operator+= (const T &rhs) |
| V += a, V = U + a, V = a + U. | |
| TDerived & | operator-= (const TDerived &rhs) |
| V -= U and W = V - U. | |
| TDerived & | operator-= (const T &rhs) |
| V -= a, V = U - a, V = a - U. | |
| TDerived & | operator*= (const T &rhs) |
| V *= a, V = U * a, V = a * U. | |
| TDerived & | operator/= (const T &rhs) |
| V /= a, V = U / a. | |
| template<typename TFunc , typename... TContainers> | |
| TDerived & | generate (TFunc &&func, const TContainers &... args) |
| Generate values from a function with optional input containers. More... | |
| template<typename TFunc , typename... TContainers> | |
| TDerived & | apply (TFunc &&func, const TContainers &... args) |
| Apply a function with optional input containers. More... | |
| TDerived | operator+ () const |
| Copy. | |
| TDerived | operator- () const |
| Compute the opposite. | |
Additional Inherited Members | |
Related Functions inherited from ContiguousContainerMixin< T, TDerived > | |
| template<typename T , typename TDerived > | |
| std::ostream & | operator<< (std::ostream &os, const ContiguousContainerMixin< T, TDerived > &container) |
Insert a ContiguousContainerMixin into an output stream. | |