VST 3 SDK VST 3.7
SDK for developing VST plug-in
|
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... | |
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
using ObjectType = ObjectT |
using ObjectTypePtr = std::unique_ptr<ObjectType, Deleter> |
|
inline |
|
inlinenoexcept |
|
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.
|
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.
|
inline |
Clear the transfer.
To be called from the non realtime context.