Navigation
API > API/Plugins > API/Plugins/MetasoundExperimentalEngineRunti-
Thread-safe, lock-free "view" over proxy data published from the game thread and consumed from the audio thread.
Modeled as a one-directional linked list: the head is the "latest" version and older nodes hold an atomic pointer to their successor so stale references can always resolve to the current head via GetLatest(). Pushing a new version is a compare-exchange on the tail's NextPtr, after which NextSharedPtr is assigned (the caller's shared-ref keeps the new head alive during the transition).
Typical usage:
struct FMyData { ... }; class FMyProxy : public Audio::TCatProxyView
// Game thread: create + publish. Proxy = FMyProxy::Create(MoveTemp(InitialData)); Proxy = Proxy->New(MoveTemp(UpdatedData));
// Audio thread: const TSharedRef
Trivial scalar updates can be applied directly on GetData() without pushing a new node; only structural changes (resizing arrays, etc.) require New().
NOTE: scratch-duplicated into MetasoundExperimentalEngineRuntime for the CAT Wave Player 2.0 move. MetasoundPolyphonyInternal retains its own copy pending consolidation (see cat-wave-player-move-spec.md §0).
Threading contract:
- New() must be called from a single thread. In practice is called from the game thread only. Callers must hold a shared ref to the head they are publishing from for the duration of the call.
- GetLatest() / IsLatest() / GetData() are safe to call concurrently from reader threads (including the audio render thread). Readers acquire-load NextPtr so the NextSharedPtr write in New() happens-before the read.
- The owning object (here, UCatSoundWaveContainer) must outlive all audio- thread readers. This is the actual contract: the Wave Player operator caches a TSharedPtr
on the audio thread and drops it in Reset(). The chain itself is kept alive by the publisher-held head ref + each node's NextSharedPtr; no reader-thread destructor coordination is required.
| Name | TCatProxyView |
| Type | class |
| Header File | /Engine/Plugins/Experimental/MetasoundExperimental/Source/MetasoundExperimentalEngineRuntime/Public/CatAudioProxyView.h |
| Include Path | #include "CatAudioProxyView.h" |
Syntax
template<typename TType, typename TData>
class TCatProxyView :
public Audio::IProxyData ,
public TSharedFromThis< TCatProxyView< TType, TData > >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → TCatProxyView
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| CatAudioProxyView.h | |||
TCatProxyView
(
EPrivateToken, |
CatAudioProxyView.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~TCatProxyView() |
CatAudioProxyView.h |
Enums
Protected
| Name | Remarks |
|---|---|
| EPrivateToken |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bWasAudioProxyClassImplemented | bool | CatAudioProxyView.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const TData & GetData () |
CatAudioProxyView.h | ||
TData & GetData () |
CatAudioProxyView.h | ||
TSharedRef< const TType > GetLatest() |
CatAudioProxyView.h | ||
bool IsLatest() |
CatAudioProxyView.h | ||
TSharedRef< TType > New
(
TData&& InData |
Publish a new data version; returns the new head. | CatAudioProxyView.h |
Public Virtual
Overridden from IUnknown
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void * QueryInterface
(
const FName InterfaceId |
Create() instantiates the base TCatProxyView (not TType) and static-casts the shared ref to TType*. | CatAudioProxyView.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedRef< TType > Create
(
TData&& InData |
Create a fresh proxy reference; takes ownership of InData. | CatAudioProxyView.h |