TBufferedData

Container type for double buffered physics 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 DataType>
class TBufferedData

Remarks

Container type for double buffered physics data. Wrap whatever results object in this to have well definied semantics for accessing each side of a buffer and flipping it

Constructors

Name Description

Public function

TBufferedData()

Functions

Name Description

Public function

void

 

Flip()

Flips the double buffer, no locks here - if synchronizing multiple threads make sure there's a lock somewhere

Public function

DataType &

 

Get

(
    int32 InIndex
)

Direct access to buffered data, useful to initialise members before beginning simulation.

Public function Const

const DataTy...

 

GetGameDataForRead()

Get a readable reference for the game thread side of the double buffer

Public function

DataType &

 

GetGameDataForWrite()

Only for the game side to call, gets a writable reference to the game side data.

Public function Const

int32

 

GetGameDataSyncCount()

Get the counter for the last written state on the game side

Public function Const

const DataTy...

 

GetPhysicsDataForRead()

Get a readable reference for the physics side of the double buffer

Public function

DataType &

 

GetPhysicsDataForWrite()

Only for the physics side to call, gets a writable reference to the physics side and increments the current sync counter to uniquely identify this write

Public function Const

int32

 

GetPhysicsDataSyncCount()

Get the counter for the last written state on the physics side

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