Navigation
API > API/Runtime > API/Runtime/IrisCore
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
| Name | FPropertyReplicationState |
| Type | class |
| Header File | /Engine/Source/Runtime/Net/Iris/Public/Iris/ReplicationState/PropertyReplicationState.h |
| Include Path | #include "Iris/ReplicationState/PropertyReplicationState.h" |
Syntax
class FPropertyReplicationState
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPropertyReplicationState
(
const FPropertyReplicationState& Other |
Copy constructor, will not copy internal data | Iris/ReplicationState/PropertyReplicationState.h | |
FPropertyReplicationState
(
const FReplicationStateDescriptor* Descriptor |
Construct a new state, StateBuffer will be allocated and constructed according to data in the descriptor | Iris/ReplicationState/PropertyReplicationState.h | |
FPropertyReplicationState
(
const FReplicationStateDescriptor* Descriptor, |
Construct a new state, using already constructed state in InStateBuffer | Iris/ReplicationState/PropertyReplicationState.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FPropertyReplicationState() |
Iris/ReplicationState/PropertyReplicationState.h |
Structs
| Name | Remarks |
|---|---|
| FCallRepNotifiesParameters | |
| FPollParameters |
Enums
Public
| Name | Remarks |
|---|---|
| FPropertyReplicationState |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bOwnState | uint32 | Iris/ReplicationState/PropertyReplicationState.h | ||
| ReplicationStateDescriptor | TRefCountPtr< const FReplicationStateDescriptor > | Iris/ReplicationState/PropertyReplicationState.h | ||
| StateBuffer | uint8 * | Iris/ReplicationState/PropertyReplicationState.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CallRepNotifies
(
void*__restrict DstData, |
Invoke repnotifies for all dirty members | Iris/ReplicationState/PropertyReplicationState.h | |
void CallRepNotifies
(
void*__restrict DstData, |
Iris/ReplicationState/PropertyReplicationState.h | ||
void CopyDirtyProperties
(
const FPropertyReplicationState& Other |
Copy dirty properties from the other state including changemask | Iris/ReplicationState/PropertyReplicationState.h | |
void GetPropertyValue
(
uint32 Index, |
Retrieve the value at the provided Index by writing it to DstValue. | Iris/ReplicationState/PropertyReplicationState.h | |
const FReplicationStateDescriptor * GetReplicationStateDescriptor() |
Iris/ReplicationState/PropertyReplicationState.h | ||
uint8 * GetStateBuffer() |
Iris/ReplicationState/PropertyReplicationState.h | ||
bool IsCustomConditionEnabled
(
uint32 Index |
If state has custom conditionals then this function will check whether the condition is enabled or not. | Iris/ReplicationState/PropertyReplicationState.h | |
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 | Iris/ReplicationState/PropertyReplicationState.h | |
bool IsDirtyForPolling () |
Returns true if state is marked dirty for polling | Iris/ReplicationState/PropertyReplicationState.h | |
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 | Iris/ReplicationState/PropertyReplicationState.h | |
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 | Iris/ReplicationState/PropertyReplicationState.h | |
bool PollObjectReferences
(
const void*__restrict SrcData |
Poll data from object referencing properties in SrcData, Note: SrcData is a UObject containing properties. | Iris/ReplicationState/PropertyReplicationState.h | |
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. | Iris/ReplicationState/PropertyReplicationState.h | |
bool PollPushBasedPropertyReplicationState
(
const void*__restrict SrcData, |
Partial poll src data from properties in SrcData based on the state of the inlined per member pollmask non-pushbased properties are always polled, Compare and update representation in DstStateBuffer and update ChangeMask. | Iris/ReplicationState/PropertyReplicationState.h | |
void PushPropertyReplicationState
(
const UObject* Owner, |
Push received state data to properties in DstData buffer. | Iris/ReplicationState/PropertyReplicationState.h | |
void Set
(
const FPropertyReplicationState& Other |
Set from Other this will update dirtiness by comparing all properties | Iris/ReplicationState/PropertyReplicationState.h | |
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 system Set 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 | Iris/ReplicationState/PropertyReplicationState.h | |
bool StoreCurrentPropertyReplicationStateForRepNotifies
(
const void*__restrict SrcData, |
Certain rep notifies requires the current state to be stored before we overwrite it, this method will copy property values from src data, , where SrcData is a UClass/UStruct containing properties if the property is marked as dirty in NewStateToBeApplied | Iris/ReplicationState/PropertyReplicationState.h | |
| Debug output state to FString | Iris/ReplicationState/PropertyReplicationState.h | ||
const TCHAR * ToString
(
FStringBuilderBase& StringBuilder, |
Debug output state to StringBuilder | Iris/ReplicationState/PropertyReplicationState.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void MarkArrayDirty
(
uint32 Index |
Explicitly mark an array at the given Index as dirty. | Iris/ReplicationState/PropertyReplicationState.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPropertyReplicationState & operator=
(
const FPropertyReplicationState& Other |
Assignment operator, it is debatable if this should be provided or not. | Iris/ReplicationState/PropertyReplicationState.h |