Klang C++
Language Reference (draft)
|
Variable-sized array, pre-allocated to a max. capacity. More...
#include <klang.h>
Public Member Functions | |
unsigned int | size () const |
The current number of items in the array. | |
void | add (const TYPE &item) |
Add the specified item to the end of the array. | |
TYPE * | add () |
Add a blank item to the end of the array, returning a pointer that allows the item to be modified. | |
void | clear () |
Clear the array contents. Only resets the item count, without wiping memory. | |
float | max () const |
Find the maximum value in the array. | |
float | mean () const |
Find the mean average of values in the array. | |
float | rms () const |
Find the root mean squared (RMS) average of values in the array. | |
void | normalise (float target=1.f, int mode=Peak) |
Normalises values in the array to the specified target, based on peak, mean, or RMS value;. | |
TYPE & | operator[] (int index) |
Returns a reference to the array item at the given index. | |
const TYPE & | operator[] (int index) const |
Returns a read-only reference to the array item at the given index. | |
Array (std::initializer_list< TYPE > init_list) | |
Construct an array given the specified values. | |
Array ()=default | |
Construct an empty array. | |
Static Public Member Functions | |
static int | capacity () |
The maximum capacity of the array. | |
Public Attributes | |
TYPE | items [CAPACITY] |
unsigned int | count = 0 |
|
inline |
|
default |
|
inline |
|
inline |
Definition at line 249 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
|
inlinestatic |
|
inline |
Definition at line 262 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count.
|
inline |
|
inline |
|
inline |
Definition at line 290 of file klang.h.
|
inline |
Definition at line 300 of file klang.h.
References klang::Array< TYPE, CAPACITY >::items.
Referenced by klang::Synth::onControl(), and klang::Synth::onPreset().
|
inline |
Definition at line 303 of file klang.h.
References klang::Array< TYPE, CAPACITY >::items.
Referenced by klang::Controls::operator=(), and klang::Presets::operator=().
|
inline |
|
inline |
unsigned int klang::Array< TYPE, CAPACITY >::count = 0 |
Definition at line 240 of file klang.h.
Referenced by klang::Array< TYPE, CAPACITY >::add(), klang::Array< TYPE, CAPACITY >::clear(), and klang::Array< TYPE, CAPACITY >::size().
TYPE klang::Array< TYPE, CAPACITY >::items[CAPACITY] |
Definition at line 239 of file klang.h.
Referenced by klang::Array< TYPE, CAPACITY >::add(), klang::Array< TYPE, CAPACITY >::operator[](), and klang::Array< TYPE, CAPACITY >::operator[]().