arduino-audio-tools
Loading...
Searching...
No Matches
Vector< T > Class Template Reference

Vector implementation which provides the most important methods as defined by std::vector. This class it is quite handy to have and most of the times quite better then dealing with raw c arrays. More...

#include <CodecOpusOgg.h>

Classes

class  iterator
 Iterator for the Vector class. More...

Public Member Functions

 Vector (Allocator &allocator)
 Constructor with only allocator.
 Vector (Allocator &allocator)
 Constructor with only allocator.
 Vector (const Vector< T > &copyFrom)
 copy constructor
 Vector (const Vector< T > &copyFrom)
 copy constructor
 Vector (int size, T value, Allocator &allocator=DefaultAllocator)
 Allocate size and initialize array.
 Vector (int size, T value, Allocator &allocator=DefaultAllocator)
 Allocate size and initialize array.
 Vector (size_t len=0, Allocator &allocator=DefaultAllocator)
 Default constructor: size 0 with DefaultAllocator: The len defines the capacity.
 Vector (size_t len=0, Allocator &allocator=DefaultAllocator)
 Default constructor: size 0 with DefaultAllocator: The len defines the capacity.
 Vector (T *from, T *to, Allocator &allocator=DefaultAllocator)
 legacy constructor with pointer range
 Vector (T *from, T *to, Allocator &allocator=DefaultAllocator)
 legacy constructor with pointer range
template<typename TT, int N>
 Vector (TT(&a)[N])
 convert from c array
template<typename TT, int N>
 Vector (TT(&a)[N])
 convert from c array
 Vector (Vector< T > &&moveFrom)
 Move constructor.
 Vector (Vector< T > &&moveFrom)
 Move constructor.
virtual ~Vector ()
 Destructor.
virtual ~Vector ()
 Destructor.
void assign (iterator v1, iterator v2)
void assign (iterator v1, iterator v2)
void assign (size_t number, T value)
void assign (size_t number, T value)
T & back ()
T & back ()
iterator begin ()
iterator begin ()
int capacity ()
int capacity ()
void clear ()
void clear ()
bool contains (T obj)
bool contains (T obj)
T * data ()
T * data ()
bool empty ()
bool empty ()
iterator end ()
iterator end ()
void erase (int pos)
void erase (int pos)
void erase (iterator it)
void erase (iterator it)
int indexOf (T obj)
int indexOf (T obj)
 operator bool () const
 operator bool () const
Vector< T > & operator= (const Vector< T > &copyFrom)
 copy operator
Vector< T > & operator= (const Vector< T > &copyFrom)
 copy operator
Vector & operator= (Vector &&moveFrom)
 Move operator.
Vector & operator= (Vector &&moveFrom)
 Move operator.
T & operator[] (const int index) const
T & operator[] (const int index) const
T & operator[] (int index)
T & operator[] (int index)
void pop_back ()
void pop_back ()
void pop_front ()
void pop_front ()
void push_back (T &&value)
void push_back (T &&value)
void push_back (T &value)
void push_back (T &value)
void push_front (T &&value)
void push_front (T &&value)
void push_front (T &value)
void push_front (T &value)
void reset ()
void reset ()
bool resize (size_t newSize)
bool resize (size_t newSize)
bool resize (size_t newSize, T value)
bool resize (size_t newSize, T value)
void setAllocAssertActive (bool flag)
void setAllocAssertActive (bool flag)
void setAllocator (Allocator &allocator)
void setAllocator (Allocator &allocator)
void shrink_to_fit ()
void shrink_to_fit ()
int size ()
int size ()
void swap (T &other)
void swap (T &other)
void swap (Vector< T > &in)
void swap (Vector< T > &in)

Protected Member Functions

void cleanup (T *data, int from, int to)
void cleanup (T *data, int from, int to)
void deleteArray (T *oldData, int oldBufferLen)
void deleteArray (T *oldData, int oldBufferLen)
T * newArray (int newSize)
T * newArray (int newSize)
void resize_internal (int newSize, bool copy, bool shrink=false)
void resize_internal (int newSize, bool copy, bool shrink=false)

Protected Attributes

int bufferLen = 0
bool is_alloc_assert_active = true
int len = 0
Allocator * p_allocator = &DefaultAllocator
T * p_data = nullptr

Detailed Description

template<class T>
class audio_tools::audio_tools::Vector< T >

Vector implementation which provides the most important methods as defined by std::vector. This class it is quite handy to have and most of the times quite better then dealing with raw c arrays.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ Vector() [1/14]

template<class T>
Vector ( size_t len = 0,
Allocator & allocator = DefaultAllocator )
inline

Default constructor: size 0 with DefaultAllocator: The len defines the capacity.

◆ Vector() [2/14]

template<class T>
Vector ( Allocator & allocator)
inline

Constructor with only allocator.

◆ Vector() [3/14]

template<class T>
Vector ( int size,
T value,
Allocator & allocator = DefaultAllocator )
inline

Allocate size and initialize array.

◆ Vector() [4/14]

template<class T>
Vector ( Vector< T > && moveFrom)
inline

Move constructor.

◆ Vector() [5/14]

template<class T>
Vector ( const Vector< T > & copyFrom)
inline

copy constructor

◆ Vector() [6/14]

template<class T>
template<typename TT, int N>
Vector ( TT(&) a[N])
inline

convert from c array

◆ Vector() [7/14]

template<class T>
Vector ( T * from,
T * to,
Allocator & allocator = DefaultAllocator )
inline

legacy constructor with pointer range

◆ ~Vector() [1/2]

template<class T>
virtual ~Vector ( )
inlinevirtual

Destructor.

◆ Vector() [8/14]

template<class T>
Vector ( size_t len = 0,
Allocator & allocator = DefaultAllocator )
inline

Default constructor: size 0 with DefaultAllocator: The len defines the capacity.

◆ Vector() [9/14]

template<class T>
Vector ( Allocator & allocator)
inline

Constructor with only allocator.

◆ Vector() [10/14]

template<class T>
Vector ( int size,
T value,
Allocator & allocator = DefaultAllocator )
inline

Allocate size and initialize array.

◆ Vector() [11/14]

template<class T>
Vector ( Vector< T > && moveFrom)
inline

Move constructor.

◆ Vector() [12/14]

template<class T>
Vector ( const Vector< T > & copyFrom)
inline

copy constructor

◆ Vector() [13/14]

template<class T>
template<typename TT, int N>
Vector ( TT(&) a[N])
inline

convert from c array

◆ Vector() [14/14]

template<class T>
Vector ( T * from,
T * to,
Allocator & allocator = DefaultAllocator )
inline

legacy constructor with pointer range

◆ ~Vector() [2/2]

template<class T>
virtual ~Vector ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ assign() [1/4]

template<class T>
void assign ( iterator v1,
iterator v2 )
inline

◆ assign() [2/4]

template<class T>
void assign ( iterator v1,
iterator v2 )
inline

◆ assign() [3/4]

template<class T>
void assign ( size_t number,
T value )
inline

◆ assign() [4/4]

template<class T>
void assign ( size_t number,
T value )
inline

◆ back() [1/2]

template<class T>
T & back ( )
inline

◆ back() [2/2]

template<class T>
T & back ( )
inline

◆ begin() [1/2]

template<class T>
iterator begin ( )
inline

◆ begin() [2/2]

template<class T>
iterator begin ( )
inline

◆ capacity() [1/2]

template<class T>
int capacity ( )
inline

◆ capacity() [2/2]

template<class T>
int capacity ( )
inline

◆ cleanup() [1/2]

template<class T>
void cleanup ( T * data,
int from,
int to )
inlineprotected

◆ cleanup() [2/2]

template<class T>
void cleanup ( T * data,
int from,
int to )
inlineprotected

◆ clear() [1/2]

template<class T>
void clear ( )
inline

◆ clear() [2/2]

template<class T>
void clear ( )
inline

◆ contains() [1/2]

template<class T>
bool contains ( T obj)
inline

◆ contains() [2/2]

template<class T>
bool contains ( T obj)
inline

◆ data() [1/2]

template<class T>
T * data ( )
inline

◆ data() [2/2]

template<class T>
T * data ( )
inline

◆ deleteArray() [1/2]

template<class T>
void deleteArray ( T * oldData,
int oldBufferLen )
inlineprotected

◆ deleteArray() [2/2]

template<class T>
void deleteArray ( T * oldData,
int oldBufferLen )
inlineprotected

◆ empty() [1/2]

template<class T>
bool empty ( )
inline

◆ empty() [2/2]

template<class T>
bool empty ( )
inline

◆ end() [1/2]

template<class T>
iterator end ( )
inline

◆ end() [2/2]

template<class T>
iterator end ( )
inline

◆ erase() [1/4]

template<class T>
void erase ( int pos)
inline

◆ erase() [2/4]

template<class T>
void erase ( int pos)
inline

◆ erase() [3/4]

template<class T>
void erase ( iterator it)
inline

◆ erase() [4/4]

template<class T>
void erase ( iterator it)
inline

◆ indexOf() [1/2]

template<class T>
int indexOf ( T obj)
inline

◆ indexOf() [2/2]

template<class T>
int indexOf ( T obj)
inline

◆ newArray() [1/2]

template<class T>
T * newArray ( int newSize)
inlineprotected

◆ newArray() [2/2]

template<class T>
T * newArray ( int newSize)
inlineprotected

◆ operator bool() [1/2]

template<class T>
operator bool ( ) const
inline

◆ operator bool() [2/2]

template<class T>
operator bool ( ) const
inline

◆ operator=() [1/4]

template<class T>
Vector< T > & operator= ( const Vector< T > & copyFrom)
inline

copy operator

◆ operator=() [2/4]

template<class T>
Vector< T > & operator= ( const Vector< T > & copyFrom)
inline

copy operator

◆ operator=() [3/4]

template<class T>
Vector & operator= ( Vector< T > && moveFrom)
inline

Move operator.

◆ operator=() [4/4]

template<class T>
Vector & operator= ( Vector< T > && moveFrom)
inline

Move operator.

◆ operator[]() [1/4]

template<class T>
T & operator[] ( const int index) const
inline

◆ operator[]() [2/4]

template<class T>
T & operator[] ( const int index) const
inline

◆ operator[]() [3/4]

template<class T>
T & operator[] ( int index)
inline

◆ operator[]() [4/4]

template<class T>
T & operator[] ( int index)
inline

◆ pop_back() [1/2]

template<class T>
void pop_back ( )
inline

◆ pop_back() [2/2]

template<class T>
void pop_back ( )
inline

◆ pop_front() [1/2]

template<class T>
void pop_front ( )
inline

◆ pop_front() [2/2]

template<class T>
void pop_front ( )
inline

◆ push_back() [1/4]

template<class T>
void push_back ( T && value)
inline

◆ push_back() [2/4]

template<class T>
void push_back ( T && value)
inline

◆ push_back() [3/4]

template<class T>
void push_back ( T & value)
inline

◆ push_back() [4/4]

template<class T>
void push_back ( T & value)
inline

◆ push_front() [1/4]

template<class T>
void push_front ( T && value)
inline

◆ push_front() [2/4]

template<class T>
void push_front ( T && value)
inline

◆ push_front() [3/4]

template<class T>
void push_front ( T & value)
inline

◆ push_front() [4/4]

template<class T>
void push_front ( T & value)
inline

◆ reset() [1/2]

template<class T>
void reset ( )
inline

◆ reset() [2/2]

template<class T>
void reset ( )
inline

◆ resize() [1/4]

template<class T>
bool resize ( size_t newSize)
inline

◆ resize() [2/4]

template<class T>
bool resize ( size_t newSize)
inline

◆ resize() [3/4]

template<class T>
bool resize ( size_t newSize,
T value )
inline

◆ resize() [4/4]

template<class T>
bool resize ( size_t newSize,
T value )
inline

◆ resize_internal() [1/2]

template<class T>
void resize_internal ( int newSize,
bool copy,
bool shrink = false )
inlineprotected

◆ resize_internal() [2/2]

template<class T>
void resize_internal ( int newSize,
bool copy,
bool shrink = false )
inlineprotected

◆ setAllocAssertActive() [1/2]

template<class T>
void setAllocAssertActive ( bool flag)
inline

◆ setAllocAssertActive() [2/2]

template<class T>
void setAllocAssertActive ( bool flag)
inline

◆ setAllocator() [1/2]

template<class T>
void setAllocator ( Allocator & allocator)
inline

◆ setAllocator() [2/2]

template<class T>
void setAllocator ( Allocator & allocator)
inline

◆ shrink_to_fit() [1/2]

template<class T>
void shrink_to_fit ( )
inline

◆ shrink_to_fit() [2/2]

template<class T>
void shrink_to_fit ( )
inline

◆ size() [1/2]

template<class T>
int size ( )
inline

◆ size() [2/2]

template<class T>
int size ( )
inline

◆ swap() [1/4]

template<class T>
void swap ( T & other)
inline

◆ swap() [2/4]

template<class T>
void swap ( T & other)
inline

◆ swap() [3/4]

template<class T>
void swap ( Vector< T > & in)
inline

◆ swap() [4/4]

template<class T>
void swap ( Vector< T > & in)
inline

Member Data Documentation

◆ bufferLen

template<class T>
int bufferLen = 0
protected

◆ is_alloc_assert_active

template<class T>
bool is_alloc_assert_active = true
protected

◆ len

template<class T>
int len = 0
protected

◆ p_allocator

template<class T>
Allocator * p_allocator = &DefaultAllocator
protected

◆ p_data

template<class T>
T * p_data = nullptr
protected

The documentation for this class was generated from the following files: