Class faabric::util::SnapshotMergeRegion

class SnapshotMergeRegion

Defines how diffs in the given snapshot region should be interpreted wrt the original snapshot.

For example, it may specify that the change should be treated as an integer that needs to be summed (i.e. the diff is the current value minus the original), or just as a region of raw bytes that needs to be XORed with the original.

A merge region specifies an offset, length, data type and operation, e.g. an integer to be summed at offset 100 with a length of 4.

Public Functions

SnapshotMergeRegion() = default
SnapshotMergeRegion(uint32_t offsetIn, size_t lengthIn, SnapshotDataType dataTypeIn, SnapshotMergeOperation operationIn)
void addDiffs(std::vector<SnapshotDiff> &diffs, std::span<const uint8_t> originalData, std::span<uint8_t> updatedData, const std::vector<char> &dirtyRegions)
inline bool operator<(const SnapshotMergeRegion &other) const

This allows us to sort the merge regions which is important for diffing purposes.

inline bool operator==(const SnapshotMergeRegion &other) const

Public Members

uint32_t offset = 0
size_t length = 0
SnapshotDataType dataType = SnapshotDataType::Raw
SnapshotMergeOperation operation = SnapshotMergeOperation::Bytewise