Audio Processing Framework (APF) version 0.5.0
|
Derived from std::vector
, but without memory re-allocations.
More...
#include <apf/container.h>
Inherits std::vector< T >.
Public Member Functions | |
fixed_vector (fixed_vector &&)=default | |
fixed_vector (const fixed_vector &)=delete | |
fixed_vector & | operator= (const fixed_vector &)=delete |
fixed_vector & | operator= (fixed_vector &&)=delete |
template<typename... Args, typename = internal::if_first_not_integral<Args...>> | |
fixed_vector (Args &&... args) | |
Constructor that forwards everything except if first type is integral. More... | |
fixed_vector (size_type n) | |
template<typename Size , typename Arg , typename = internal::if_integral<Size>> | |
fixed_vector (Size n, Arg &&arg, const Allocator &a) | |
template<typename Size , typename... Args, typename = internal::if_integral<Size>, typename = internal::if_last_not_convertible<Allocator, Args...>> | |
fixed_vector (Size n, Args &&... args) | |
Constructor from size and initialization arguments. More... | |
fixed_vector (std::initializer_list< value_type > il, const Allocator &a=Allocator()) | |
void | resize (size_type n) |
Reserve space for new elements and default-construct them. More... | |
void | reserve (size_type n) |
Reserve space for new elements. More... | |
template<typename... Args> | |
void | emplace_back (Args &&... args) |
Construct element at the end. More... | |
Derived from std::vector
, but without memory re-allocations.
Non-copyable types can be used as long as they are movable. Normally, the size is specified in the constructor and doesn't change ever. If you need to initialize the fixed_vector before you know its final size, there is one exception: You can initialize the fixed_vector with the default constructor, at a later time you can call reserve() and afterwards emplace_back(). In this case the size grows, but the memory is still never re-allocated.
std::vector
:Definition at line 82 of file container.h.
|
inlineexplicit |
Constructor that forwards everything except if first type is integral.
Definition at line 110 of file container.h.
|
inlineexplicit |
Definition at line 122 of file container.h.
|
inline |
Definition at line 127 of file container.h.
|
inlineexplicit |
Constructor from size and initialization arguments.
This can be used for initializing nested containers, for example.
Definition at line 136 of file container.h.
|
inlineexplicit |
Definition at line 148 of file container.h.
|
inline |
Reserve space for new elements and default-construct them.
In contrast to std::vector::resize()
, this can only be called once and only on an empty fixed_vector (i.e. iff capacity == 0). Thus, resize() will allocate memory, but never re-allocate.
std::logic_error | if capacity != 0 |
Definition at line 159 of file container.h.
Referenced by apf::fixed_matrix< T, Allocator >::initialize().
|
inline |
Reserve space for new elements.
In contrast to std::vector::reserve()
, this can only be called once and only on an empty fixed_vector (i.e. iff capacity == 0). Thus, reserve() will allocate memory, but never re-allocate.
std::logic_error | if capacity != 0 |
Definition at line 178 of file container.h.
Referenced by apf::MimoProcessor< Derived, interface_policy, query_policy >::MimoProcessor().
|
inline |
Construct element at the end.
In contrast to std::vector::emplace_back()
this can only be called after reserve() and at most as many times as specified in reserve() (and is typically called exactly as many times). Thus, memory will never be allocated.
std::logic_error | if capacity would be exceeded |
Definition at line 199 of file container.h.
Referenced by apf::MimoProcessor< Derived, interface_policy, query_policy >::MimoProcessor().