Navigation
API > API/Runtime > API/Runtime/IrisCore > API/Runtime/IrisCore/Iris > API/Runtime/IrisCore/Iris/ReplicationState
References
| Module | IrisCore |
| Header | /Engine/Source/Runtime/Experimental/Iris/Core/Public/Iris/ReplicationState/PropertyReplicationState.h |
| Include | #include "Iris/ReplicationState/PropertyReplicationState.h" |
Syntax
class FPropertyReplicationState
Remarks
ReplicationState created at runtime using a descriptor built from existing reflection data StateBuffer contains storage for all properties described by the descriptor, When polling data from the source object properties we will compare the value with what we have stored in the statebuffer and mark the member as dirty.if the value differs
Polling is quite expensive but we only do it once per update of the replication system
Constructors
| Type | Name | Description | |
|---|---|---|---|
FPropertyReplicationState
(
const FReplicationStateDescriptor* Descriptor |
Construct a new state, StateBuffer will be allocated and constructed according to data in the descriptor | ||
FPropertyReplicationState
(
const FPropertyReplicationState& Other |
Copy constructor, will not copy internal data | ||
FPropertyReplicationState
(
const FReplicationStateDescriptor* Descriptor, |
Construct a new state, using already constructed state in InStateBuffer |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CallRepNotifies
(
void*__restrict DstData, |
Invoke repnotifies for all dirty members | |
| void | CallRepNotifies
(
void*__restrict DstData, |
Invoke repnotifies for all dirty members | |
| void | GetPropertyValue
(
uint32 Index, |
Set the value at the provided Index, written into DstValue. | |
| const FReplicationStateDescriptor * | |||
| uint8 * | |||
| bool | IsCustomConditionEnabled
(
uint32 Index |
If state has custom conditionals then this function will check whether the condition is enabled or not. | |
| bool | IsDirty
(
uint32 Index |
Is the property at the given index dirty, for properties with multiple bits in the statemask this will return true if any of those bits are set | |
| bool | IsValid () |
Either StateBuffer is initialized and owned by this instance, or we have been injected with a state from the network system A default constructed state is not valid | |
| void | MarkArrayDirty
(
uint32 Index |
Explicitly mark an array at the given Index as dirty. | |
| void | MarkDirty
(
uint32 Index |
Explicitly mark the property at the given Index as dirty, for properties with multiple bits in the statemask this will mark all bits dirty | |
| bool | PollObjectReferences
(
const void*__restrict SrcData |
Poll data from object referencing properties in SrcData, Note: SrcData is a UObject containing properties. | |
| void | PollProperty
(
const void* SrcData, |
Polls source data for a single property. If the property has changed it will be marked as dirty. | |
| bool | PollPropertyReplicationState
(
const void*__restrict SrcData |
$IRIS TODO: Move Poll/Push/CallRepNotifies out of PropertyReplicationState as loose functions Poll src data from properties in SrcData, where SrcData is a UClass/UStruct containing properties. | |
| bool | PollPropertyReplicationStateForRepNotifies
(
const void*__restrict SrcData |
Poll src data from properties which we want to store in order to determine if we need to call RepNotifies | |
| void | PushPropertyReplicationState
(
void*__restrict DstData, |
Push received state data to properties in DstData buffer, Note: DstData is a UClass/UStruct containing properties Compare and update representation in DstStateBuffer and update ChangeMask | |
| void | Set
(
const FPropertyReplicationState& Other |
Set from Other this will update dirtiness by comparing all properties | |
| void | SetPropertyValue
(
uint32 Index, |
Note: There is little to none error checking in the methods below, they are mostly intended to be used from internal code and tests Expected usage for this type of ReplicationState is through the polling systemSet the value at the provided Index, The UProperty is looked up from the descriptor using the index, if the value differs the statemask is updated Mostly intended for test code Normal use of this class is through the poll layer TODO: It would be nice if we could provide some validation on property types | |
| FString | ToString
(
bool bIncludeAll |
Debug output state to FString | |
| const TCHAR * | ToString
(
FStringBuilderBase& StringBuilder, |
Debug output state to StringBuilder |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FPropertyReplicationState & | operator=
(
const FPropertyReplicationState& Other |
Assignment operator, it is debatable if this should be provided or not. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCallRepNotifiesParameters |
Constants
| Name | Description |
|---|---|
| TArrayElementChangeMaskBitOffset | At which offset in the TArray changemask element dirtiness begins. |
| TArrayElementChangeMaskBits | How many bits to use to track dirtiness for individual elements. |
| TArrayPropertyChangeMaskBitIndex | The changemask bit into the TArray changemask info that indicates the TArray is dirty. |