DotVector
extension DotVector
-
Search for a given counter key in the version vector.
Declaration
Swift
internal func search(_ key: String) -> IndexParameters
keythe counter to locate
Return Value
the index in the vector where the counter key should be to stay ordered
-
Create new instance holding a version vector with the counter for the given key incremented by one.
Declaration
Swift
internal func inc(_ key: String) -> Array<Element>Parameters
keythe key of the counter to increment
Return Value
new VersionVector instance
-
Determine if this version vector descends from another.
Declaration
Swift
internal func descends(_ other: `Self`) -> BoolParameters
rhsthe version vector to check against
Return Value
true if this instance descends from or is equal to
other -
Locate the counter for the given key, returning 0 if not found
Declaration
Swift
internal func counter(of key: String) -> UInt64Parameters
keythe key to look for
Return Value
the counter value if found or nil
-
Generate a Dot instance using the counter + 1 for the given key
Declaration
Swift
internal func dot(of key: String) -> DotParameters
keythe key of the counter to use
Return Value
new Dot instance
-
Merge two Dot collections. Resulting collection of Dot entities will be ordered by their
idvalue and counters will be the max value found in both collections.Declaration
Swift
internal func merge(_ other: `Self`) -> Array<Element>Parameters
otherthe collection to merge with
Return Value
new collection of Dot instances
View on GitHub
DotVector Extension Reference