Mozzi  version v1.1.0
sound synthesis library for Arduino
Stack< T, NUM_ITEMS > Class Template Reference

A simple stack, used internally for keeping track of analog input channels as they are read. More...

#include <Stack.h>

Public Member Functions

 Stack ()
 Constructor.
 
void push (T item)
 Put an item on the stack. More...
 
pop ()
 Get the item on top of the stack. More...
 

Detailed Description

template<class T, int NUM_ITEMS>
class Stack< T, NUM_ITEMS >

A simple stack, used internally for keeping track of analog input channels as they are read.

This stack is really just an array with a pointer to the most recent item, and memory is allocated at compile time.

Template Parameters
Tthe kind of numbers (or other things) to store.
NUM_ITEMSthe maximum number of items the stack will need to hold.

Definition at line 18 of file Stack.h.

Member Function Documentation

◆ pop()

template<class T , int NUM_ITEMS>
T Stack< T, NUM_ITEMS >::pop ( )
inline

Get the item on top of the stack.

Returns
T the item

Definition at line 45 of file Stack.h.

◆ push()

template<class T , int NUM_ITEMS>
void Stack< T, NUM_ITEMS >::push ( item)
inline

Put an item on the stack.

Parameters
itemthe thing you want to put on the stack.

Definition at line 34 of file Stack.h.