/Engine/Plugins/Animation/RigLogic/Source/RigLogicLib/Public/terse/types/ArchiveOffset.h
ArchiveOffsetis a type that stores an absolute stream offset (both in-memory and writes that value into the stream as well). It has an accompanyingProxytype, which is a virtual, utility type, and they work together to achieve the function ofArchiveOffset. WhenArchiveOffsetis encountered during the serialization process, at first an empty offset (zero) value will be written into the stream and the position of that offset value will be captured in an in-memory variable. Later, when its associated ArchiveOffset::Proxy is encountered, the current stream position will be captured, and it will update the in-memory value of itsArchiveOffsetwith it. Then, it will seek the stream to the earlier captured position of the offset value (where zeros were written initially), and it will write the offset value captured by the proxy into the stream. Lastly, it will seek back to the position of the stream before the proxy was encountered, and resume serialization.
template<typename TOffset> struct ArchiveOffset
std::size_t
position
The position of the marker itself in the stream (this is a runtime-only value which is not written to the file, needed only for the serializer to know where to seek within the stream when the marker's actual value needs to be written)
Proxy*
proxy
When offset is moved, it's associated proxy must be updated about the new address.
ValueType
value
The position in the stream where the marker wants to point (this is the actual value that is written to the file)