Readonly
peersA set of logical clocks of other peers.
Readonly
sidSession ID (or actor ID, site ID, process ID, etc.), a random identifier randomly assigned to each editing session.
Logical time (or sequence number, tick, etc.), a monotonically increasing integer, starting from 0. It does not produce gaps on local machine, but it can produce gaps when merged with other clocks.
Needs to be mutable in vector clock. Other than that, it should be treated as immutable.
Returns a deep copy of the current vector clock with the same session ID.
A new vector clock, which is a clone of the current vector clock.
Returns a deep copy of the current vector clock with a different session ID.
The session ID of the new vector clock.
A new vector clock, which is a fork of the current vector clock.
Advances local time every time we see any timestamp with higher time value. This is an idempotent method which can be called every time a new timestamp is observed, it advances the local time only if the observed timestamp is greater than the current local time.
The time stamp we observed.
Length of the time span.
Returns a new timestamp, which is the current clock value, and advances the clock by a number of cycles.
Number of cycles to advance the clock.
A new timestamp, which is the current clock value.
Represents a clock vector, which is a local logical clock together with a set of logical clocks of other peers.