TChaosReadWriteResource

Lockable resource for use with chaos data.

Windows
MacOS
Linux

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/BufferedData.h

Include

#include "Chaos/Framework/BufferedData.h"

Syntax

template<typename ResourceType>
class TChaosReadWriteResource

Remarks

Lockable resource for use with chaos data. External threads should call GetRead and ReleaseRead on this object to lock it for read. When this is done the physics thread will not be allowed to swap the buffers so external reads are safe. Physics code can use GetWritable to get access to the write buffer, no locks are performed here as the lock is only required from the physics side when swapping the buffers. No external thread should ever attempt to swap the buffer. Only the owning thread

Constructors

Name Description

Public function

TChaosReadWriteResource

(
    EInPlace,
    ArgTypes&&... Args
)

Functions

Name Description

Public function Const

const Resour...

 

GetRead()

Gets the readable version of the resource

Public function Const

const Resour...

 

GetReadable()

Gets the owning thread's const readable side of the buffer

Public function

ResourceType...

 

GetWritable()

Gets the owning thread's writable side of the buffer

Public function Const

void

 

ReleaseRead()

Release read locks

Public function

void

 

Swap()

Swaps the read/write sides of the buffer safely so no readers are interrupted (grabs a write lock)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss