VST 3 SDK VST 3.7 SDK for developing VST plug-in

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
Public Member Functions | List of all members
RingBuffer< ItemT > Class Template Reference

Ringbuffer. More...

`#include <ringbuffer.h>`

## Public Member Functions
| RingBuffer (size_t initialNumberOfItems=0) noexcept
| Default constructor.
size_t | size () const noexcept
| size
void | resize (size_t newNumberOfItems) noexcept
| resize
bool | push (ItemT &&item) noexcept
| push a new item into the ringbuffer
bool | push (const ItemT &item) noexcept
| push a new item into the ringbuffer
bool | pop (ItemT &item) noexcept
| pop an item out of the ringbuffer

## Detailed Description

### template<typename ItemT>
class Steinberg::OneReaderOneWriter::RingBuffer< ItemT >

Ringbuffer.

A ringbuffer supporting one reader and one writer thread

## Constructor & Destructor Documentation

RingBuffer | ( | size_t | initialNumberOfItems = `0` | ) |
| inline noexcept

Default constructor.

Parameters

  initialNumberOfItems | initial ring buffer size

## Member Function Documentation

size_t size | ( |  | ) | const
| inline noexcept

size

Returns
  number of elements the buffer can hold

void resize | ( | size_t | newNumberOfItems | ) |
| inline noexcept

resize

note that you have to make sure that no other thread is reading or writing while calling this method

Parameters

  newNumberOfItems | resize buffer

bool push | ( | ItemT && | item | ) |
| inline noexcept

push a new item into the ringbuffer

Parameters

  item | to push

Returns
  true on success or false if buffer is full

bool push | ( | const ItemT & | item | ) |
| inline noexcept

push a new item into the ringbuffer

Parameters

  item | to push

Returns
  true on success or false if buffer is full

bool pop | ( | ItemT & | item | ) |
| inline noexcept

pop an item out of the ringbuffer

Parameters

  item |

Returns
  true on success or false if buffer is empty

Empty

Copyright ©2022 Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.