VST 3 SDK  VST 3.7
SDK for developing VST plug-in
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
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

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

Constructor & Destructor Documentation

RTTransferT ( )
inline
~RTTransferT ( )
inlinenoexcept

Member Function Documentation

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.

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.

void clear_ui ( )
inline

Clear the transfer.

To be called from the non realtime context.

Empty

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