HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Heph::SignedArithmeticBuffer< Tself, Tdata > Class Template Reference

base class for buffers that store signed arithmetic types. Provides operations and methods for signed arithmetic data. More...

#include <ArithmeticBuffer.h>

Inheritance diagram for Heph::SignedArithmeticBuffer< Tself, Tdata >:
Heph::ArithmeticBuffer< Tself, Tdata > Heph::BufferUnaryMinusOperator< Tself, Tdata > Heph::BufferBase< Tself, Tdata > Heph::BufferArithmeticOperators< Tself, Tdata > Heph::BufferArithmeticOperators< Tself, Tdata, Tself, Tdata > Heph::BufferDivisionOperator< Tself, Tdata, Tself, Tdata > Heph::BufferMultiplicationOperator< Tself, Tdata, Tself, Tdata > Heph::BufferSubtractionOperator< Tself, Tdata, Tself, Tdata > Heph::BufferAdditionOperator< Tself, Tdata, Tself, Tdata > Heph::BufferDivisionOperator< Tself, Tdata, Tdata, Tdata > Heph::BufferMultiplicationOperator< Tself, Tdata, Tdata, Tdata > Heph::BufferSubtractionOperator< Tself, Tdata, Tdata, Tdata > Heph::BufferAdditionOperator< Tself, Tdata, Tdata, Tdata >

Public Member Functions

virtual ~SignedArithmeticBuffer ()=default
 
void Invert ()
 
Tdata AbsMax () const
 
- Public Member Functions inherited from Heph::ArithmeticBuffer< Tself, Tdata >
virtual ~ArithmeticBuffer ()=default
 
Tdata Min () const
 
Tdata Max () const
 
double Rms () const
 
- Public Member Functions inherited from Heph::BufferBase< Tself, Tdata >
virtual ~BufferBase ()
 
virtual Tself operator<< (size_t rhs) const
 
virtual Tself & operator<<= (size_t rhs)
 
virtual Tself operator>> (size_t rhs) const
 
virtual Tself & operator>>= (size_t rhs)
 
virtual bool operator== (const Tself &rhs) const
 
virtual bool operator!= (const Tself &rhs) const
 
Tdata & operator[] (size_t index) const
 
size_t Size () const
 
size_t SizeAsByte () const
 
Tdata & At (size_t index) const
 
virtual bool IsEmpty () const
 
virtual void Reset ()
 
virtual void Release ()
 
virtual Tself SubBuffer (size_t index, size_t size) const
 
virtual void Prepend (const Tself &rhs)
 
virtual void Append (const Tself &rhs)
 
virtual void Insert (const Tself &rhs, size_t index)
 
virtual void Cut (size_t index, size_t size)
 
virtual void Replace (const Tself &rhs, size_t index)
 
virtual void Replace (const Tself &rhs, size_t index, size_t size)
 
virtual void Resize (size_t newSize)
 
virtual void Reverse ()
 
Tdata * begin () const
 
Tdata * end () const
 
- Public Member Functions inherited from Heph::BufferArithmeticOperators< Tself, Tdata >
 BufferArithmeticOperators (const BufferArithmeticOperators &)=delete
 
BufferArithmeticOperatorsoperator= (const BufferArithmeticOperators &)=delete
 
- Public Member Functions inherited from Heph::BufferAdditionOperator< Tself, Tdata, Tdata, Tdata >
 BufferAdditionOperator (const BufferAdditionOperator &)=delete
 
BufferAdditionOperatoroperator= (const BufferAdditionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferSubtractionOperator< Tself, Tdata, Tdata, Tdata >
 BufferSubtractionOperator (const BufferSubtractionOperator &)=delete
 
BufferSubtractionOperatoroperator= (const BufferSubtractionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferMultiplicationOperator< Tself, Tdata, Tdata, Tdata >
 BufferMultiplicationOperator (const BufferMultiplicationOperator &)=delete
 
BufferMultiplicationOperatoroperator= (const BufferMultiplicationOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferDivisionOperator< Tself, Tdata, Tdata, Tdata >
 BufferDivisionOperator (const BufferDivisionOperator &)=delete
 
BufferDivisionOperatoroperator= (const BufferDivisionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferArithmeticOperators< Tself, Tdata, Tself, Tdata >
 BufferArithmeticOperators (const BufferArithmeticOperators &)=delete
 
BufferArithmeticOperatorsoperator= (const BufferArithmeticOperators &)=delete
 
- Public Member Functions inherited from Heph::BufferAdditionOperator< Tself, Tdata, Tself, Tdata >
 BufferAdditionOperator (const BufferAdditionOperator &)=delete
 
BufferAdditionOperatoroperator= (const BufferAdditionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferSubtractionOperator< Tself, Tdata, Tself, Tdata >
 BufferSubtractionOperator (const BufferSubtractionOperator &)=delete
 
BufferSubtractionOperatoroperator= (const BufferSubtractionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferMultiplicationOperator< Tself, Tdata, Tself, Tdata >
 BufferMultiplicationOperator (const BufferMultiplicationOperator &)=delete
 
BufferMultiplicationOperatoroperator= (const BufferMultiplicationOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferDivisionOperator< Tself, Tdata, Tself, Tdata >
 BufferDivisionOperator (const BufferDivisionOperator &)=delete
 
BufferDivisionOperatoroperator= (const BufferDivisionOperator &)=delete
 
- Public Member Functions inherited from Heph::BufferUnaryMinusOperator< Tself, Tdata >
 BufferUnaryMinusOperator (const BufferUnaryMinusOperator &)=delete
 
BufferUnaryMinusOperatoroperator= (const BufferUnaryMinusOperator &)=delete
 

Protected Member Functions

 SignedArithmeticBuffer ()
 
 SignedArithmeticBuffer (size_t size)
 
 SignedArithmeticBuffer (size_t size, BufferFlags flags)
 
 SignedArithmeticBuffer (const std::initializer_list< Tdata > &rhs)
 
 SignedArithmeticBuffer (const SignedArithmeticBuffer &rhs)
 
 SignedArithmeticBuffer (SignedArithmeticBuffer &&rhs) noexcept
 
- Protected Member Functions inherited from Heph::ArithmeticBuffer< Tself, Tdata >
 ArithmeticBuffer ()
 
 ArithmeticBuffer (size_t size)
 
 ArithmeticBuffer (size_t size, BufferFlags flags)
 
 ArithmeticBuffer (const std::initializer_list< Tdata > &rhs)
 
 ArithmeticBuffer (const ArithmeticBuffer &rhs)
 
 ArithmeticBuffer (ArithmeticBuffer &&rhs) noexcept
 
- Protected Member Functions inherited from Heph::BufferBase< Tself, Tdata >
 BufferBase ()
 
 BufferBase (size_t size)
 
 BufferBase (size_t size, BufferFlags flags)
 
 BufferBase (const std::initializer_list< Tdata > &rhs)
 
 BufferBase (const BufferBase &rhs)
 
 BufferBase (BufferBase &&rhs) noexcept
 
Tself & operator= (const std::initializer_list< Tdata > &rhs)
 
Tself & operator= (const Tself &rhs)
 
Tself & operator= (Tself &&rhs) noexcept
 

Additional Inherited Members

- Static Protected Member Functions inherited from Heph::BufferBase< Tself, Tdata >
static size_t SizeAsByte (size_t size)
 
template<typename U = Tdata>
static std::enable_if< std::is_class< U >::value >::type Initialize (U *pData, U *pDataEnd)
 
template<typename U = Tdata>
static std::enable_if<!std::is_class< U >::value >::type Initialize (U *pData, U *pDataEnd)
 
static Tdata * Allocate (size_t size_byte)
 
static Tdata * AllocateUninitialized (size_t size_byte)
 
static Tdata * SubBuffer (Tdata *pThisData, size_t thisSize_byte, size_t index_byte, size_t subBufferSize_byte)
 
static Tdata * Prepend (Tdata *pThisData, size_t thisSize_byte, Tdata *pRhsData, size_t rhsSize_byte)
 
static Tdata * Append (Tdata *pThisData, size_t thisSize_byte, Tdata *pRhsData, size_t rhsSize_byte)
 
static Tdata * Insert (Tdata *pThisData, size_t thisSize_byte, Tdata *pRhsData, size_t rhsSize_byte, size_t index_byte)
 
static Tdata * Cut (Tdata *pThisData, size_t thisSize_byte, size_t index_byte, size_t &cutSize_byte)
 
static void Replace (Tdata *pThisData, size_t thisSize_byte, Tdata *pRhsData, size_t rhsSize_byte, size_t index_byte)
 
- Protected Attributes inherited from Heph::BufferBase< Tself, Tdata >
Tdata * pData
 
size_t size
 
- Static Protected Attributes inherited from Heph::ArithmeticBuffer< Tself, Tdata >
static constexpr Tdata MIN_ELEMENT = std::numeric_limits<Tdata>::lowest()
 
static constexpr Tdata MAX_ELEMENT = std::numeric_limits<Tdata>::max()
 

Detailed Description

template<class Tself, typename Tdata>
class Heph::SignedArithmeticBuffer< Tself, Tdata >

base class for buffers that store signed arithmetic types. Provides operations and methods for signed arithmetic data.

Template Parameters
TselfType of the final buffer that inherits from this class (CRTP).
TdataType of the data the buffer stores, must be signed arithmetic type.

Constructor & Destructor Documentation

◆ SignedArithmeticBuffer() [1/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( )
inlineprotected

creates a new instance and initializes it with default values.

◆ SignedArithmeticBuffer() [2/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( size_t size)
inlineexplicitprotected

creates a new instance and initializes it with the provided values.

Parameters
sizenumber of elements the buffer will store.

◆ SignedArithmeticBuffer() [3/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( size_t size,
BufferFlags flags )
inlineprotected

creates a new instance and initializes it with the provided values.

Parameters
sizenumber of elements the buffer will store.
flagsflags.

◆ SignedArithmeticBuffer() [4/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( const std::initializer_list< Tdata > & rhs)
inlineprotected

creates a new instance and initializes it with the provided values.

Parameters
rhsa list of elements the buffer will store.

◆ SignedArithmeticBuffer() [5/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( const SignedArithmeticBuffer< Tself, Tdata > & rhs)
inlineprotected

creates a new instance and copies the rhs's data to it.

Parameters
rhsinstance whose data will be copied.

◆ SignedArithmeticBuffer() [6/6]

template<class Tself , typename Tdata >
Heph::SignedArithmeticBuffer< Tself, Tdata >::SignedArithmeticBuffer ( SignedArithmeticBuffer< Tself, Tdata > && rhs)
inlineprotectednoexcept

creates a new instance and moves the rhs's data to it.

Parameters
rhsinstance whose data will be moved.

◆ ~SignedArithmeticBuffer()

template<class Tself , typename Tdata >
virtual Heph::SignedArithmeticBuffer< Tself, Tdata >::~SignedArithmeticBuffer ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Invert()

template<class Tself , typename Tdata >
void Heph::SignedArithmeticBuffer< Tself, Tdata >::Invert ( )
inline

inverts the elements.

◆ AbsMax()

template<class Tself , typename Tdata >
Tdata Heph::SignedArithmeticBuffer< Tself, Tdata >::AbsMax ( ) const
inline

gets the absolute maximum value stored in the buffer.