ape  0.5.0
Audio Programming Environment
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
ape::umatrix< T > Struct Template Reference

A container representing a 2d rectangular array (and can be used syntactically like one). As with uarray, the source contents is unowned and the dimensionality is constant. Row-major order, where each "row" is a channel and can be accessed through a uarray. More...

#include <misc.h>

Classes

struct  iterator
 Iterator for enumerating the rows of a umatrix umatrix<T>::begin() More...
 

Public Types

typedef T value_type
 

Public Member Functions

 umatrix (T *const *data, std::size_t channelsOrRows, std::size_t samplesOrColumns)
 Construct from a pointer array. More...
 
uarray< T > operator[] (std::size_t row) const CPPAPE_NOEXCEPT_IF_RELEASE
 Access the row in the matrix. More...
 
iterator begin () const noexcept
 Retrieve an iterator that can enumerate channels contained in this matrix. More...
 
iterator end () const noexcept
 Retrieve an iterator pointing to one past the last channel in this matrix.

See also
begin()
More...
 
std::size_t samples () const noexcept
 
std::size_t channels () const noexcept
 
std::size_t rows () const noexcept
 
See also
channels()
More...
 
std::size_t columns () const noexcept
 
See also
samples()
More...
 
auto pointers ()
 Returns a possibly cv-qualified T * const* More...
 
const auto pointers () const noexcept
 
 operator umatrix< const T > () const noexcept
 Implicit conversion operator to a constant read-only version of this umatrix More...
 

Protected Attributes

T *const * data
 
std::size_t numRows
 
std::size_t numColumns
 

Detailed Description

template<typename T>
struct ape::umatrix< T >

A container representing a 2d rectangular array (and can be used syntactically like one). As with uarray, the source contents is unowned and the dimensionality is constant. Row-major order, where each "row" is a channel and can be accessed through a uarray.

This class is a drop-in safe replacements for expressions like: T** data, int samples, int channels Or aliasing actually mutable 2d audio sources like AudioFile or DynamicSampleMatrix.

Template Parameters
TThe source content type. Append const to the type for perfectly enforced read-only access to the contents.

Member Typedef Documentation

◆ value_type

template<typename T>
typedef T ape::umatrix< T >::value_type

Constructor & Destructor Documentation

◆ umatrix()

template<typename T>
ape::umatrix< T >::umatrix ( T *const *  data,
std::size_t  channelsOrRows,
std::size_t  samplesOrColumns 
)
inline

Construct from a pointer array.

Member Function Documentation

◆ begin()

template<typename T>
iterator ape::umatrix< T >::begin ( ) const
inlinenoexcept

Retrieve an iterator that can enumerate channels contained in this matrix.

◆ channels()

template<typename T>
std::size_t ape::umatrix< T >::channels ( ) const
inlinenoexcept
Returns
How many rows / channels are in this matrix

◆ columns()

template<typename T>
std::size_t ape::umatrix< T >::columns ( ) const
inlinenoexcept

See also
samples()

◆ end()

template<typename T>
iterator ape::umatrix< T >::end ( ) const
inlinenoexcept

Retrieve an iterator pointing to one past the last channel in this matrix.

See also
begin()

◆ operator umatrix< const T >()

template<typename T>
ape::umatrix< T >::operator umatrix< const T > ( ) const
inlinenoexcept

Implicit conversion operator to a constant read-only version of this umatrix

◆ operator[]()

template<typename T>
uarray<T> ape::umatrix< T >::operator[] ( std::size_t  row) const
inline

Access the row in the matrix.

Returns
A uarray aliasing the contents.

◆ pointers() [1/2]

template<typename T>
auto ape::umatrix< T >::pointers ( )
inline

Returns a possibly cv-qualified T * const*

◆ pointers() [2/2]

template<typename T>
const auto ape::umatrix< T >::pointers ( ) const
inlinenoexcept

◆ rows()

template<typename T>
std::size_t ape::umatrix< T >::rows ( ) const
inlinenoexcept

See also
channels()

◆ samples()

template<typename T>
std::size_t ape::umatrix< T >::samples ( ) const
inlinenoexcept
Returns
How many columns / samples are in this matrix

Member Data Documentation

◆ data

template<typename T>
T* const * ape::umatrix< T >::data
protected

◆ numColumns

template<typename T>
std::size_t ape::umatrix< T >::numColumns
protected

◆ numRows

template<typename T>
std::size_t ape::umatrix< T >::numRows
protected

The documentation for this struct was generated from the following file: