VST 3 SDK: RingBuffer< ItemT > Class Template Reference
Author: Steinberg

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

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. More...
size_t | size () const noexcept
| size More...
void | resize (size_t newNumberOfItems) noexcept
| resize More...
bool | push (ItemT &&item) noexcept
| push a new item into the ringbuffer More...
bool | push (const ItemT &item) noexcept
| push a new item into the ringbuffer More...
bool | pop (ItemT &item) noexcept
| pop an item out of the ringbuffer More...

## Detailed Description

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

Ringbuffer.

A ringbuffer supporting one reader and one writer thread

## Constructor & Destructor Documentation

## ◆ RingBuffer()

RingBuffer | ( | size_t | initialNumberOfItems = `0` | ) |
| inlinenoexcept

Default constructor.

Parameters

  initialNumberOfItems | initial ring buffer size

## Member Function Documentation

## ◆ size()

size_t size | ( |  | ) | const
| inlinenoexcept

size

Returns
  number of elements the buffer can hold

## ◆ resize()

void resize | ( | size_t | newNumberOfItems | ) |
| inlinenoexcept

resize

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

Parameters

  newNumberOfItems | resize buffer

## ◆ push() [1/2]

bool push | ( | ItemT && | item | ) |
| inlinenoexcept

push a new item into the ringbuffer

Parameters

  item | to push

Returns
  true on success or false if buffer is full

## ◆ push() [2/2]

bool push | ( | const ItemT & | item | ) |
| inlinenoexcept

push a new item into the ringbuffer

Parameters

  item | to push

Returns
  true on success or false if buffer is full

## ◆ pop()

bool pop | ( | ItemT & | item | ) |
| inlinenoexcept

pop an item out of the ringbuffer

Parameters

  item |

Returns
  true on success or false if buffer is empty

Empty

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