#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 | Holder = DataContainerHolder< T, TContainer > |
The concrete data holder type. | |
Public Types inherited from ContiguousContainerMixin< T, TDerived > | |
using | value_type = T |
The value type. | |
using | reference = T & |
The value reference. | |
using | const_reference = const T & |
The constant value reference. | |
using | iterator = T * |
The value iterator. | |
using | const_iterator = const T * |
The constant value iterator. | |
using | difference_type = std::ptrdiff_t |
The iterator difference type. | |
using | size_type = std::size_t |
The underlying container size type. | |
Public Member Functions | |
Element access | |
T * | data () |
Inherit data holder's data() . | |
const std::decay_t< TContainer > & | container () const |
Access the container in read-only mode. | |
const T * | data () const |
Inherit data holder's data() . | |
Operations | |
std::vector< T > | vector () const |
Copy the container values into an std::vector . More... | |
Data modifiers | |
TContainer & | moveTo (TContainer &destination) |
Move the container. More... | |
Properties | |
std::size_t | size () const |
Inherit data holder's size() . | |
Public Member Functions inherited from ContiguousContainerMixin< T, TDerived > | |
bool | emtpy () 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. | |