Arduino DLNA Server
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
tiny_dlna::Vector< T, Alloc > Class Template Reference

Lightweight wrapper around std::vector with Arduino-friendly helpers and a pluggable allocator. More...

#include <Vector.h>

Inheritance diagram for tiny_dlna::Vector< T, Alloc >:
Inheritance graph
[legend]

Public Types

using Base = std::vector< T, Alloc >
 
using value_type = T
 
using iterator = typename Base::iterator
 
using const_iterator = typename Base::const_iterator
 

Public Member Functions

 Vector ()=default
 
 Vector (size_t count)
 
 Vector (size_t count, const T &value)
 
template<class It >
 Vector (It first, It last)
 
 Vector (std::initializer_list< T > il)
 
 Vector (const Alloc &alloc)
 
void eraseIndex (int index)
 Erase element by index (no-op on out-of-range).
 
iterator erase (size_t index)
 Convenience overload to erase by index.
 
void reset ()
 Reset the container by clearing and shrinking capacity to fit.
 

Detailed Description

template<class T, class Alloc = DLNA_ALLOCATOR<T>>
class tiny_dlna::Vector< T, Alloc >

Lightweight wrapper around std::vector with Arduino-friendly helpers and a pluggable allocator.

This container inherits from std::vector to preserve its API and complexity guarantees while adding a few conveniences tailored for embedded/Arduino targets:

Template parameters:

Complexity: Matches std::vector for the corresponding operations (e.g. erase is linear in the number of moved elements). Reserve/capacity/iterator invalidation rules are also identical to std::vector.

Member Typedef Documentation

◆ Base

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
using tiny_dlna::Vector< T, Alloc >::Base = std::vector<T, Alloc>

◆ const_iterator

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
using tiny_dlna::Vector< T, Alloc >::const_iterator = typename Base::const_iterator

◆ iterator

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
using tiny_dlna::Vector< T, Alloc >::iterator = typename Base::iterator

◆ value_type

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
using tiny_dlna::Vector< T, Alloc >::value_type = T

Constructor & Destructor Documentation

◆ Vector() [1/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
tiny_dlna::Vector< T, Alloc >::Vector ( )
default

◆ Vector() [2/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
tiny_dlna::Vector< T, Alloc >::Vector ( size_t  count)
inlineexplicit

◆ Vector() [3/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
tiny_dlna::Vector< T, Alloc >::Vector ( size_t  count,
const T &  value 
)
inline

◆ Vector() [4/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
template<class It >
tiny_dlna::Vector< T, Alloc >::Vector ( It  first,
It  last 
)
inline

◆ Vector() [5/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
tiny_dlna::Vector< T, Alloc >::Vector ( std::initializer_list< T >  il)
inline

◆ Vector() [6/6]

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
tiny_dlna::Vector< T, Alloc >::Vector ( const Alloc &  alloc)
inlineexplicit

Member Function Documentation

◆ erase()

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
iterator tiny_dlna::Vector< T, Alloc >::erase ( size_t  index)
inline

Convenience overload to erase by index.

Parameters
indexZero-based index to erase.
Returns
iterator Iterator to the element following the erased one, or end() if none.
Note
Returns end() and performs no action if the index is out of range.

◆ eraseIndex()

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
void tiny_dlna::Vector< T, Alloc >::eraseIndex ( int  index)
inline

Erase element by index (no-op on out-of-range).

Parameters
indexZero-based index of the element to erase.
Note
Equivalent to erase(begin() + index) when in range; does nothing otherwise.

◆ reset()

template<class T , class Alloc = DLNA_ALLOCATOR<T>>
void tiny_dlna::Vector< T, Alloc >::reset ( )
inline

Reset the container by clearing and shrinking capacity to fit.

Calls clear() followed by shrink_to_fit() to return memory to the system where supported. Useful on memory-constrained targets after large, temporary usage.


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