arduino-audio-driver
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 <Vector.h>

Classes

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

Public Member Functions

 Vector (int size, T value)
 allocate size and initialize array
 Vector (size_t len=20)
 default constructor
 Vector (T *from, T *to)
 legacy constructor with pointer range
 Vector (Vector< T > &&moveFrom)
 Vector (Vector< T > &copyFrom)
 copy constructor
virtual ~Vector ()
 Destructor.
void assign (iterator v1, iterator v2)
void assign (size_t number, T value)
T & back ()
iterator begin ()
int capacity ()
void clear ()
T * data ()
bool empty ()
iterator end ()
void erase (int pos)
void erase (iterator it)
 operator bool () const
Vector< T > & operator= (Vector< T > &copyFrom)
T & operator[] (const int index) const
T & operator[] (int index)
void pop_back ()
void pop_front ()
void push_back (T value)
void push_front (T value)
bool resize (int newSize)
bool resize (int newSize, T value)
void shrink_to_fit ()
int size ()
void swap (Vector< T > &in)

Protected Member Functions

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

Protected Attributes

int bufferLen =0
int len = 0
T * p_data = nullptr

Detailed Description

template<class T>
class audio_driver_local::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/5]

template<class T>
Vector ( size_t len = 20)
inline

default constructor

◆ Vector() [2/5]

template<class T>
Vector ( int size,
T value )
inline

allocate size and initialize array

◆ Vector() [3/5]

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

◆ Vector() [4/5]

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

copy constructor

◆ Vector() [5/5]

template<class T>
Vector ( T * from,
T * to )
inline

legacy constructor with pointer range

◆ ~Vector()

template<class T>
virtual ~Vector ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ assign() [1/2]

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

◆ assign() [2/2]

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

◆ back()

template<class T>
T & back ( )
inline

◆ begin()

template<class T>
iterator begin ( )
inline

◆ capacity()

template<class T>
int capacity ( )
inline

◆ cleanup()

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

◆ clear()

template<class T>
void clear ( )
inline

◆ data()

template<class T>
T * data ( )
inline

◆ empty()

template<class T>
bool empty ( )
inline

◆ end()

template<class T>
iterator end ( )
inline

◆ erase() [1/2]

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

◆ erase() [2/2]

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

◆ operator bool()

template<class T>
operator bool ( ) const
inline

◆ operator=()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ pop_back()

template<class T>
void pop_back ( )
inline

◆ pop_front()

template<class T>
void pop_front ( )
inline

◆ push_back()

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

◆ push_front()

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

◆ resize() [1/2]

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

◆ resize() [2/2]

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

◆ resize_internal()

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

◆ shrink_to_fit()

template<class T>
void shrink_to_fit ( )
inline

◆ size()

template<class T>
int size ( )
inline

◆ swap()

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

Member Data Documentation

◆ bufferLen

template<class T>
int bufferLen =0
protected

◆ len

template<class T>
int len = 0
protected

◆ p_data

template<class T>
T* p_data = nullptr
protected

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