3#ifndef ENGINE_SHARED_SNAPSHOT_H
4#define ENGINE_SHARED_SNAPSHOT_H
18 int *
Data() {
return (
int *)(
this + 1); }
23 const int *
Data()
const {
return (
int *)(
this + 1); }
36 int *
Offsets()
const {
return (
int *)(
this + 1); }
62 const void *
FindItem(
int Type,
int Id)
const;
66 bool IsValid(
size_t ActualSize)
const;
96 static void UndiffItem(
const int *pPast,
const int *pDiff,
int *pOut,
int Size,
int *pDataRate);
99 static int DiffItem(
const int *pPast,
const int *pCurrent,
int *pOut,
int Size);
141 void Add(
int Tick, int64_t Tagtime,
size_t DataSize,
const void *pData,
size_t AltDataSize,
const void *pAltData);
170 void Init(
bool Sixup =
false);
173 void *
NewItem(
int Type,
int Id,
int Size);
178 int Finish(
void *pSnapdata);
Definition: snapshot.h:146
int m_NumItems
Definition: snapshot.h:156
int m_aExtendedItemTypes[MAX_EXTENDED_ITEM_TYPES]
Definition: snapshot.h:158
CSnapshotItem * GetItem(int Index)
Definition: snapshot.cpp:736
bool m_Sixup
Definition: snapshot.h:165
void Init(bool Sixup=false)
Definition: snapshot.cpp:724
char m_aData[CSnapshot::MAX_SIZE]
Definition: snapshot.h:152
@ MAX_EXTENDED_ITEM_TYPES
Definition: snapshot.h:149
int m_aOffsets[CSnapshot::MAX_ITEMS]
Definition: snapshot.h:155
int Finish(void *pSnapdata)
Definition: snapshot.cpp:754
int m_NumExtendedItemTypes
Definition: snapshot.h:159
CSnapshotBuilder()
Definition: snapshot.cpp:719
void * NewItem(int Type, int Id, int Size)
Definition: snapshot.cpp:812
int GetExtendedItemTypeIndex(int TypeId)
Definition: snapshot.cpp:791
int * GetItemData(int Key)
Definition: snapshot.cpp:741
int GetTypeFromIndex(int Index) const
Definition: snapshot.cpp:768
void Init7(const CSnapshot *pSnapshot)
Definition: sixup_translate_snapshot.cpp:5
int m_DataSize
Definition: snapshot.h:153
bool AddExtendedItemType(int Index)
Definition: snapshot.cpp:773
Definition: snapshot.h:77
int m_NumUpdateItems
Definition: snapshot.h:80
int m_aData[1]
Definition: snapshot.h:82
int m_NumTempItems
Definition: snapshot.h:81
int m_NumDeletedItems
Definition: snapshot.h:79
Definition: snapshot.h:74
int CreateDelta(const CSnapshot *pFrom, const CSnapshot *pTo, void *pDstData)
Definition: snapshot.cpp:294
CData m_Empty
Definition: snapshot.h:94
short m_aItemSizes7[MAX_NETOBJSIZES]
Definition: snapshot.h:91
static void UndiffItem(const int *pPast, const int *pDiff, int *pOut, int Size, int *pDataRate)
Definition: snapshot.cpp:233
const CData * EmptyDelta() const
Definition: snapshot.cpp:288
void SetStaticsize(int ItemType, size_t Size)
Definition: snapshot.cpp:274
int m_aSnapshotDataRate[CSnapshot::MAX_TYPE+1]
Definition: snapshot.h:92
int UnpackDelta(const CSnapshot *pFrom, CSnapshot *pTo, const void *pSrcData, int DataSize, bool Sixup)
Definition: snapshot.cpp:509
@ MAX_NETOBJSIZES
Definition: snapshot.h:88
int DebugDumpDelta(const void *pSrcData, int DataSize)
Definition: snapshot.cpp:377
static int DiffItem(const int *pPast, const int *pCurrent, int *pOut, int Size)
Definition: snapshot.cpp:216
int GetDataRate(int Index) const
Definition: snapshot.h:102
CSnapshotDelta()
Definition: snapshot.cpp:256
int m_aSnapshotDataUpdates[CSnapshot::MAX_TYPE+1]
Definition: snapshot.h:93
int GetDataUpdates(int Index) const
Definition: snapshot.h:103
void SetStaticsize7(int ItemType, size_t Size)
Definition: snapshot.cpp:281
short m_aItemSizes[MAX_NETOBJSIZES]
Definition: snapshot.h:90
Definition: snapshot.h:15
void Invalidate()
Definition: snapshot.h:27
int Id() const
Definition: snapshot.h:25
int m_TypeAndId
Definition: snapshot.h:21
const int * Data() const
Definition: snapshot.h:23
int Type() const
Definition: snapshot.h:24
int Key() const
Definition: snapshot.h:26
int * Data()
Definition: snapshot.h:18
Definition: snapshot.h:118
int m_Tick
Definition: snapshot.h:124
int m_SnapSize
Definition: snapshot.h:126
int m_AltSnapSize
Definition: snapshot.h:127
CHolder * m_pPrev
Definition: snapshot.h:120
CHolder * m_pNext
Definition: snapshot.h:121
CSnapshot * m_pAltSnap
Definition: snapshot.h:130
int64_t m_Tagtime
Definition: snapshot.h:123
CSnapshot * m_pSnap
Definition: snapshot.h:129
Definition: snapshot.h:115
~CSnapshotStorage()
Definition: snapshot.h:137
CSnapshotStorage()
Definition: snapshot.h:136
void PurgeAll()
Definition: snapshot.cpp:620
void Add(int Tick, int64_t Tagtime, size_t DataSize, const void *pData, size_t AltDataSize, const void *pAltData)
Definition: snapshot.cpp:660
void Init()
Definition: snapshot.cpp:614
void PurgeUntil(int Tick)
Definition: snapshot.cpp:633
CHolder * m_pLast
Definition: snapshot.h:134
int Get(int Tick, int64_t *pTagtime, const CSnapshot **ppData, const CSnapshot **ppAltData) const
Definition: snapshot.cpp:695
CHolder * m_pFirst
Definition: snapshot.h:133
Definition: snapshot.h:31
int GetExternalItemType(int InternalType) const
Definition: snapshot.cpp:38
static const CSnapshot * EmptySnapshot()
Definition: snapshot.h:68
int * Offsets() const
Definition: snapshot.h:36
const CSnapshotItem * GetItem(int Index) const
Definition: snapshot.cpp:18
size_t TotalSize() const
Definition: snapshot.h:40
char * DataStart() const
Definition: snapshot.h:37
int m_NumItems
Definition: snapshot.h:34
const void * FindItem(int Type, int Id) const
Definition: snapshot.cpp:74
int GetItemIndex(int Key) const
Definition: snapshot.cpp:58
int GetItemType(int Index) const
Definition: snapshot.cpp:32
@ MAX_ID
Definition: snapshot.h:49
@ MAX_ITEMS
Definition: snapshot.h:50
@ MAX_SIZE
Definition: snapshot.h:52
@ MAX_TYPE
Definition: snapshot.h:48
@ MAX_PARTS
Definition: snapshot.h:51
@ OFFSET_UUID_TYPE
Definition: snapshot.h:47
void InvalidateItem(int Index)
Definition: snapshot.cpp:69
void DebugDump() const
Definition: snapshot.cpp:122
unsigned Crc() const
Definition: snapshot.cpp:107
size_t OffsetSize() const
Definition: snapshot.h:39
bool IsValid(size_t ActualSize) const
Definition: snapshot.cpp:135
int m_DataSize
Definition: snapshot.h:33
int NumItems() const
Definition: snapshot.h:55
static const CSnapshot ms_EmptySnapshot
Definition: snapshot.h:42
int GetItemSize(int Index) const
Definition: snapshot.cpp:25