A representation of the Logootish Document Model for mapping "real,"
known_positions to Logoot positions. This is useful when working
with strings, arrays, or, just in general, anything that needs a fixed order.
This does not actually store the data in question, but stores a mapping of
real indices in the data to the Logoot positions of that element. This is
used to transform edits between ones in the Logoot and local position spaces.
One important thing to note: Logoot edits (insertions/removals) can be
applied in any order. Local edits must be applied in a consistent order.
The BST maps out where all insertion nodes are in the local document's memory. It is used to go from position -> node
This BST maps Logoot position identifiers to their text node to allow lookup of text position from Logoot ID
A map of removals that do not yet have text to remove
See the Logoot paper for why. Unlike the Logoot implementation, this is incremented with each removal only and is kept constant with insertions.
Calculate the Logoot positions of a local insertion.
The index of new text
How much will be inserted
A Logoot insertion with a Logoot position (
start), a vector
clock value (
rclk) (copied from the document), and the length passed
to the function (
length). Note that the start position is not copied,
so if it is modified, it will mess up the sorting trees. Ensure that it is
copied before modifying it.
Calculate the local positions inserted from an insertion at a Logoot position from a given length and vector clock.
LogootPosition of the insertion
The length of the insertion
The vector clock when the insertion took place.
An object with the
insertions member set to an array with
objects containing a numeric
offset, which represents which part of the
source string the insertion is pulling from, a numeric
length, and a
known_position where to place the string. Insertions must be
applied in the order of the return value. The object also has a
variable set to an array of objects containing
length that represent removed conflicts with existing data. These
removals should be applied before the
Calculate the Logoot positions and lengths of removals from a removal in the local document.
The index of old text
The length text that will be removed
An object containing an array of removals and the calculated
vector clock. Each removal contains a
start LogootPosition, which is not
copied, so it cannot be modified, and a numeric
Calculate the regions of text to be removed from the local document from a Logoot position, length, and vector clock of a removal.
The start at which to start removing.
How much to remove.
The vector clock of the removal.
An object containing a member
removals, which is an array of
objects containing a
known_position at which to start removing and a
length, both of which are numbers.
Generated using TypeDoc