VST 3 SDK: RTTransferT< ObjectT, Deleter > Struct Template Reference
Author: Steinberg

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

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
RTTransferT< ObjectT, Deleter > Struct Template Reference

Transfer objects from a non realtime thread to a realtime one. More...

`#include <rttransfer.h>`

## Public Types
using | ObjectType = ObjectT
using | ObjectTypePtr = std::unique_ptr<ObjectType, Deleter>

## Public Member Functions
| RTTransferT ()
| ~RTTransferT () noexcept
template<typename Proc>
void | accessTransferObject_rt (Proc proc) noexcept
| Access the transfer object.
void | transferObject_ui (ObjectTypePtr &&newObjectPtr)
| Transfer an object to the realtime context.
void | clear_ui ()
| Clear the transfer.

## Detailed Description

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>
struct Steinberg::Vst::RTTransferT< ObjectT, Deleter >

Transfer objects from a non realtime thread to a realtime one.

You have to use it from two threads, the realtime context thread where you are not allowed to block and a non realtime thread from where the object is coming.

It's guaranteed that the function you should only call in the realtime context is wait free and does not do any allocations or deallocations

## Member Typedef Documentation

## ◆ ObjectType

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

using ObjectType = ObjectT

## ◆ ObjectTypePtr

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

using ObjectTypePtr = std::unique_ptr<ObjectType, Deleter>

## Constructor & Destructor Documentation

## ◆ RTTransferT()

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

RTTransferT | ( |  | ) |
| inline

## ◆ ~RTTransferT()

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

~RTTransferT | ( |  | ) |
| inlinenoexcept

## Member Function Documentation

## ◆ accessTransferObject_rt()

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>
template<typename Proc>

void accessTransferObject_rt | ( | Proc | proc | ) |
| inlinenoexcept

Access the transfer object.

If there's a new object, the proc is called with the new object. The object is only valid inside the proc.

To be called from the realtime context.

## ◆ transferObject_ui()

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

void transferObject_ui | ( | ObjectTypePtr && | newObjectPtr | ) |
| inline

Transfer an object to the realtime context.

The ownership of newObject is transfered to this object and the Deleter is used to free the memory of it afterwards.

If there's already an object in transfer the previous object will be deallocated and replaced with the new one without passing to the realtime context.

To be called from the non realtime context.

## ◆ clear_ui()

template<typename ObjectT, typename Deleter = std::default_delete<ObjectT>>

void clear_ui | ( |  | ) |
| inline

Clear the transfer.

To be called from the non realtime context.

Empty

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