Class: HistoryBuffer

Defined in: lib/HistoryBuffer.coffee

Overview

Note: The HistoryBuffer is commonly abbreviated to HB.

An object that holds all applied operations.

Instance Method Summary

Constructor Details

# (void) constructor(user_id)

Creates an empty HB.

Parameters:

  • user_id ( Object ) Creator of the HB.

Instance Method Details

# (void) getUserId()

Get the user id with wich the History Buffer was initialized.

# (void) getReservedUniqueIdentifier()

There is only one reserved unique identifier (uid), so use it wisely. I propose to use it in your Framework, to create something like a root element. An operation with this identifier is not propagated to other clients. This is why everybode must create the same operation with this uid.

# (void) getOperationCounter()

Get the operation counter that describes the current state of the document.

# (void) _encode(state_vector = {})

Encode this operation in such a way that it can be parsed by remote peers.

# (void) getNextOperationIdentifier(user_id)

Get the number of operations that were created by a user. Accordingly you will get the next operation number that is expected from that user. This will increment the operation counter.

# (void) getOperation(uid)

Retrieve an operation from a unique id.

# (void) addOperation(o)

Add an operation to the HB. Note that this will not link it against other operations (it wont executed)

# (void) addToCounter(o)

Increment the operation_counter that defines the current state of the Engine.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: