BaseCRDTDocument class abstract

Defines the foundational contract for a CRDT document.

This abstract class serves as the common interfaces between the live CRDTDocument and the static read-only document.

Implementers

Constructors

BaseCRDTDocument()
Creates a document with no handler open.

Properties

documentId → String
Gets the document ID of this document
no setter
hashCode → int
The hash code for this object.
no setterinherited
hlc → HybridLogicalClock
Gets the current timestamp of this document
no setter
isDisposed → bool
Whether the document is disposed
no setter
peerId → PeerId
Gets the peer ID of this document
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
version → Set<OperationId>
Gets the current version of this document (the frontiers of the DAG)
no setter

Methods

changeCountForHandler(String handlerId) → int
Returns the number of Changes produced by the handler with the given handlerId.
changesForHandler(String handlerId, {VersionVector? fromVersionVector}) → List<Change>
Returns the Changes produced by the handler with the given handlerId.
deleteHandler(Handler handler) → void
Deletes handler, and every handler reachable from it through references, for every peer.
deleteHandlerRef(HandlerRef ref) → void
Deletes the handler ref points at, and every handler reachable from it, for every peer.
dispose() → void
Disposes of the document
exportChanges({Set<OperationId>? from, VersionVector? fromVersionVector}) → List<Change>
Exports Changes from a specific version.
handler<T extends Handler>(HandlerSpec<T> spec, String id) → T
The handler spec describes under id, or the one already open there.
handlerById(String id) → Handler?
The handler open under id; null when none is.
isDeleted(String handlerId) → bool
Whether the handler with handlerId was deleted with deleteHandler, on this peer or on a peer whose changes this document holds.
newHandlerId() → String
Generates a globally-unique id for a handler created dynamically.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareMutation() → void
Prepares the system to perform a mutation.
register<T extends Handler>(HandlerSpec<T> spec) → void
Declares a kind this peer never opens itself, so a reference to one can still be rebuilt.
registerOperation(Operation operation) → void
Registers an Operation to this document.
resolveHandler(HandlerRef ref) → Handler?
Resolves ref to a handler instance.
revisionForHandler(String handlerId) → int
A monotonically increasing revision for the handler with the given handlerId.
runInTransaction<T>(T action(), {Object? origin}) → T
Runs action as one transaction: its operations reach the other peers together.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited