Exemplo n.º 1
0
 private bool Equals(VectorClock other)
 {
     return(IsSameAs(other));
 }
Exemplo n.º 2
0
 /// <summary>
 /// <para>
 /// Compares the current vector clock with the supplied vector clock. The outcome will be one of the following:
 /// </para>
 /// <ol>
 /// <li><![CDATA[ Clock 1 is SAME(==)       as Clock 2 iff for all i c1(i) == c2(i) ]]></li>
 /// <li><![CDATA[ Clock 1 is BEFORE(<)      Clock 2 iff for all i c1(i) <= c2(i) and there exist a j such that c1(j) < c2(j) ]]></li>
 /// <li><![CDATA[ Clock 1 is AFTER(>)       Clock 2 iff for all i c1(i) >= c2(i) and there exist a j such that c1(j) > c2(j). ]]></li>
 /// <li><![CDATA[ Clock 1 is CONCURRENT(<>) to Clock 2 otherwise. ]]></li>
 /// </ol>
 /// </summary>
 /// <param name="that">The vector clock used to compare against.</param>
 /// <returns>TBD</returns>
 public Ordering CompareTo(VectorClock that)
 {
     return(CompareOnlyTo(that, Ordering.FullOrder));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns true if <code>this</code> is after <code>that</code> else false.
 /// </summary>
 /// <param name="that">The other <see cref="VectorClock"/> to check.</param>
 /// <returns><c>true</c> if this vectorclock comes after the one we're comparing.</returns>
 public bool IsAfter(VectorClock that)
 {
     return(CompareOnlyTo(that, Ordering.After) == Ordering.After);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns true if this VectorClock has the same history as the 'that' VectorClock else false.
 /// </summary>
 /// <param name="that">The other <see cref="VectorClock"/> to check.</param>
 /// <returns><c>true</c> if this vectorclock is the same as the one we're comparing.</returns>
 public bool IsSameAs(VectorClock that)
 {
     return(CompareOnlyTo(that, Ordering.Same) == Ordering.Same);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns true if <code>this</code> and <code>that</code> are concurrent else false.
 /// </summary>
 /// <param name="that">The other <see cref="VectorClock"/> to check.</param>
 /// <returns><c>true</c> if both vector clocks contain concurrent modifications that need to be merged.</returns>
 public bool IsConcurrentWith(VectorClock that)
 {
     return(CompareOnlyTo(that, Ordering.Concurrent) == Ordering.Concurrent);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Returns true if <code>this</code> is before <code>that</code> else false.
 /// </summary>
 /// <param name="that">The other <see cref="VectorClock"/> to check.</param>
 /// <returns><c>true</c> if this vectorclock comes before the one we're comparing.</returns>
 public bool IsBefore(VectorClock that)
 {
     return(CompareOnlyTo(that, Ordering.Before) == Ordering.Before);
 }
Exemplo n.º 7
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="from">TBD</param>
 /// <param name="version">TBD</param>
 public GossipStatus(UniqueAddress from, VectorClock version)
 {
     _from    = from;
     _version = version;
 }
Exemplo n.º 8
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="members">TBD</param>
 /// <param name="overview">TBD</param>
 /// <param name="version">TBD</param>
 /// <returns>TBD</returns>
 public Gossip Copy(ImmutableSortedSet <Member> members = null, GossipOverview overview = null,
                    VectorClock version = null)
 {
     return(new Gossip(members ?? _members, overview ?? _overview, version ?? _version));
 }
Exemplo n.º 9
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="members">TBD</param>
 /// <param name="overview">TBD</param>
 public Gossip(ImmutableSortedSet <Member> members, GossipOverview overview) : this(members, overview, VectorClock.Create())
 {
 }
Exemplo n.º 10
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="members">TBD</param>
 public Gossip(ImmutableSortedSet <Member> members) : this(members, new GossipOverview(), VectorClock.Create())
 {
 }
Exemplo n.º 11
0
 public bool Equals(VectorClock other)
 {
     return(IsSameAs(other));
 }