Skip to main content

Module refresh

Module refresh 

Source
Expand description

The model decoded from a set of files, brought up to date with an edit of them by decoding again only the objects the edit touched. Decoding RealGrid’s 117 MB anew takes some 0.9 s, and an edit in an editor touches a handful of objects.

In each file that changed, the elements of its index before and after are compared in document order: those that differ, came or went write the objects touched. Each is removed from the model and decoded again from what every file writes of it (an EQ file’s element and an SSH file’s), the files in their order, merged as a load merges them: the model is the one a full decode gives.

Functions§

refresh
model, decoded from the files as they were, brought up to date with files as they are now (in the order the model was decoded from them); before holds each file that changed as it was, with its index. The number of objects decoded again.
refresh_objects
model with the objects ids decoded again from files as they are now (in the order the model was decoded from them): for an edit that knows the objects it touched, as crate::index::Index::edited tells. The number of objects. An error as refresh’s.