VST 3 SDK VST 3.7
SDK for developing VST plug-in
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. More...
 
void transferObject_ui (ObjectTypePtr &&newObjectPtr)
 Transfer an object to the realtime context. More...
 
void clear_ui ()
 Clear the transfer. More...
 

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

using ObjectType = ObjectT

◆ ObjectTypePtr

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

Constructor & Destructor Documentation

◆ RTTransferT()

RTTransferT ( )
inline

◆ ~RTTransferT()

~RTTransferT ( )
inlinenoexcept

Member Function Documentation

◆ accessTransferObject_rt()

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()

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()

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.