Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
NameBatchSerialization.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/ArrayView.h"
6#include "UObject/NameTypes.h"
7#include "Templates/Function.h"
8
9#define ALLOW_NAME_BATCH_SAVING PLATFORM_LITTLE_ENDIAN && !PLATFORM_TCHAR_IS_4_BYTES
10
11//////////////////////////////////////////////////////////////////////////
12
14// Save display entries in given order to a name blob and a versioned hash blob.
15void SaveNameBatch(TArrayView<const FDisplayNameEntryId> Names, TArray<uint8>& OutNameData, TArray<uint8>& OutHashData);
16
17// Save display entries in given order to an archive
18void SaveNameBatch(TArrayView<const FDisplayNameEntryId> Names, FArchive& Out);
19#endif
20
21//////////////////////////////////////////////////////////////////////////
22
23// Reserve memory in preparation for batch loading
24//
25// @param Bytes for existing and new names.
26void ReserveNameBatch(uint32 NameDataBytes, uint32 HashDataBytes);
27
28// Load a name blob with precalculated hashes.
29//
30// Names are rehashed if hash algorithm version doesn't match.
31//
32// @param NameData, HashData must be 8-byte aligned.
33void LoadNameBatch(TArray<FDisplayNameEntryId>& OutNames, TArrayView<const uint8> NameData, TArrayView<const uint8> HashData);
34
35// Load names and precalculated hashes from an archive
36//
37// Names are rehashed if hash algorithm version doesn't match.
39
40// Load names and precalculated hashes from an archive using multiple workers
41//
42// May load synchronously in some cases, like small batches.
43//
44// Names are rehashed if hash algorithm version doesn't match.
45//
46// @param Ar is drained synchronously
47// @param MaxWorkers > 0
48// @return function that waits before returning result, like a simple future.
50
51//////////////////////////////////////////////////////////////////////////
TFunction< TArray< FDisplayNameEntryId >()> LoadNameBatchAsync(FArchive &Ar, uint32 MaxWorkers)
void ReserveNameBatch(uint32 NameDataBytes, uint32 HashDataBytes)
TArray< FDisplayNameEntryId > LoadNameBatch(FArchive &Ar)
void LoadNameBatch(TArray< FDisplayNameEntryId > &OutNames, TArrayView< const uint8 > NameData, TArrayView< const uint8 > HashData)
#define ALLOW_NAME_BATCH_SAVING
#define PLATFORM_TCHAR_IS_4_BYTES
Definition Platform.h:253
#define PLATFORM_LITTLE_ENDIAN
Definition Platform.h:144