Navigation
API > API/Plugins > API/Plugins/ConcertSyncCore
This is an intermediate place for received data to live before it is further processed.
IObjectCacheUsers register with the cache and decide which data is to be received. When replication data comes in IObjectCacheUsers::WantsToAcceptObject is used to determine whether the object wants the data. If the data should be received, IObjectCacheUsers::OnDataCached is called receiving a shared ptr to the data. When the data is finally consumed latently, e.g. sent to other endpoints, the cache user resets the shared ptr. If new data comes in before a cache user consumes it, the new data and old data are combined (using IObjectReplicationFormat::CombineReplicationEvents).
This allows multiple systems to reuse replication data. For example, on the server the same data may need to be distributed to different clients but the clients send the data at different times.
| Name | FObjectReplicationCache |
| Type | class |
| Header File | /Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncCore/Source/ConcertSyncCore/Public/Replication/Processing/ObjectReplicationCache.h |
| Include Path | #include "Replication/Processing/ObjectReplicationCache.h" |
Syntax
class FObjectReplicationCache : public TSharedFromThis< FObjectReplicationCache >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FObjectReplicationCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FObjectReplicationCache
(
IObjectReplicationFormat& ReplicationFormat |
Replication/Processing/ObjectReplicationCache.h |
Structs
| Name | Remarks |
|---|---|
| FObjectCache |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Cache | TMap< FConcertObjectInStreamID, FObjectCache > | Maps every object to the events cached for it. | Replication/Processing/ObjectReplicationCache.h | |
| CacheUsers | TArray< TSharedRef< IReplicationCacheUser > > | Everyone who registered for receiving data. | Replication/Processing/ObjectReplicationCache.h | |
| ReplicationFormat | IObjectReplicationFormat & | Used for combining events to save network bandwidth. | Replication/Processing/ObjectReplicationCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void RegisterDataCacheUser
(
TSharedRef< IReplicationCacheUser > User |
Registers a new user, which will start receiving data for any new data received from now on. | Replication/Processing/ObjectReplicationCache.h | |
FCacheStoreStats StoreUntilConsumed
(
const FGuid& SendingEndpointId, |
Called when new data is received for an object and shares it with any IObjectCacheUser that is possibly interested in it. | Replication/Processing/ObjectReplicationCache.h | |
void UnregisterDataCacheUser
(
const TSharedRef< IReplicationCacheUser >& User |
Replication/Processing/ObjectReplicationCache.h |