UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::TBufferedData< DataType > Class Template Reference

#include <BufferedData.h>

Public Member Functions

 TBufferedData ()
 
void Flip ()
 
const DataType & GetGameDataForRead () const
 
const DataType & GetPhysicsDataForRead () const
 
int32 GetGameDataSyncCount () const
 
int32 GetPhysicsDataSyncCount () const
 
DataType & GetGameDataForWrite ()
 
DataType & GetPhysicsDataForWrite ()
 
DataType & Get (int32 InIndex)
 

Detailed Description

template<typename DataType>
class Chaos::TBufferedData< DataType >

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

Constructor & Destructor Documentation

◆ TBufferedData()

template<typename DataType >
Chaos::TBufferedData< DataType >::TBufferedData ( )
inline

Member Function Documentation

◆ Flip()

template<typename DataType >
void Chaos::TBufferedData< DataType >::Flip ( )
inline

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

◆ Get()

template<typename DataType >
DataType & Chaos::TBufferedData< DataType >::Get ( int32  InIndex)
inline

Direct access to buffered data, useful to initialise members before beginning simulation. Never use once the data is being managed over multiple threads

◆ GetGameDataForRead()

template<typename DataType >
const DataType & Chaos::TBufferedData< DataType >::GetGameDataForRead ( ) const
inline

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

◆ GetGameDataForWrite()

template<typename DataType >
DataType & Chaos::TBufferedData< DataType >::GetGameDataForWrite ( )
inline

Only for the game side to call, gets a writable reference to the game side data. Mainly useful for exchanging ptrs in the data type. For copying just call GetGameDataForRead

◆ GetGameDataSyncCount()

template<typename DataType >
int32 Chaos::TBufferedData< DataType >::GetGameDataSyncCount ( ) const
inline

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

◆ GetPhysicsDataForRead()

template<typename DataType >
const DataType & Chaos::TBufferedData< DataType >::GetPhysicsDataForRead ( ) const
inline

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

◆ GetPhysicsDataForWrite()

template<typename DataType >
DataType & Chaos::TBufferedData< DataType >::GetPhysicsDataForWrite ( )
inline

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

◆ GetPhysicsDataSyncCount()

template<typename DataType >
int32 Chaos::TBufferedData< DataType >::GetPhysicsDataSyncCount ( ) const
inline

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


The documentation for this class was generated from the following file: