![]()  | 
  
    VCV Rack API v2
    
   | 
 
A cyclic buffer which maintains a valid linear array of size S by sliding along a larger block of size N. More...
#include <ringbuffer.hpp>
Public Member Functions | |
| void | returnBuffer () | 
| void | push (T t) | 
| T | shift () | 
| bool | empty () const | 
| bool | full () const | 
| size_t | size () const | 
| size_t | capacity () const | 
| T * | endData (size_t n) | 
| Returns a pointer to S consecutive elements for appending, requesting to append n elements.   | |
| void | endIncr (size_t n) | 
| Actually increments the end position Must be called after endData(), and n must be at most the n passed to endData().   | |
| const T * | startData () const | 
| Returns a pointer to S consecutive elements for consumption If any data is consumed, call startIncr afterwards.   | |
| void | startIncr (size_t n) | 
Public Attributes | |
| size_t | start = 0 | 
| size_t | end = 0 | 
| T | data [N] | 
A cyclic buffer which maintains a valid linear array of size S by sliding along a larger block of size N.
This is not thread-safe. The linear array of S elements are moved back to the start of the block once it outgrows past the end. This happens every N - S pushes, so the push() time is O(1 + S / (N - S)). For example, a float buffer of size 64 in a block of size 1024 is nearly as efficient as RingBuffer. Not thread-safe.
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
Returns a pointer to S consecutive elements for appending, requesting to append n elements.
      
  | 
  inline | 
      
  | 
  inline | 
Returns a pointer to S consecutive elements for consumption If any data is consumed, call startIncr afterwards.
      
  | 
  inline | 
| size_t rack::dsp::AppleRingBuffer< T, S, N >::start = 0 | 
| size_t rack::dsp::AppleRingBuffer< T, S, N >::end = 0 | 
| T rack::dsp::AppleRingBuffer< T, S, N >::data[N] |