Esempio n. 1
0
 public static ItcEvent Tree(int aValue, ItcEvent aLeft, ItcEvent aRight)
 {
     var leftSingle = aLeft as ItcEventSingle;
     var rightSingle = aRight as ItcEventSingle;
     if (leftSingle != null && rightSingle != null && leftSingle.Min == rightSingle.Min)
     {
         return new ItcEventSingle(aValue + leftSingle.Min);
     }
     int sinkAmount = Math.Min(aLeft.Min, aRight.Min);
     return new ItcEventTree(aValue + sinkAmount, aLeft.Sink(sinkAmount), aRight.Sink(sinkAmount));
 }
Esempio n. 2
0
 public override ItcEvent Join(ItcEvent aOther)
 {
     var otherSingle = aOther as ItcEventSingle;
     if (otherSingle != null)
     {
         if (otherSingle.iValue > iValue)
         {
             return otherSingle;
         }
         return this;
     }
     return aOther.Join(this);
 }
Esempio n. 3
0
 public override bool Leq(ItcEvent aOther)
 {
     return iValue <= aOther.Min;
 }
Esempio n. 4
0
 public override ItcEvent Join(ItcEvent aOther)
 {
     return Tree(
         0,
         Left.Join(aOther.Left),
         Right.Join(aOther.Right));
 }
Esempio n. 5
0
 public override bool Leq(ItcEvent aOther)
 {
     return
         iValue <= aOther.Min &&
         Left.Leq(aOther.Left) &&
         Right.Leq(aOther.Right);
 }
Esempio n. 6
0
File: ItcId.cs Progetto: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     return aEvent.InternalGrow(iLeft, iRight, out aCost);
 }
Esempio n. 7
0
 public ItcEventTree(int aValue, ItcEvent aLeft, ItcEvent aRight)
     : base(aValue)
 {
     iLeft = aLeft;
     iRight = aRight;
 }
Esempio n. 8
0
File: ItcId.cs Progetto: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     throw new InvalidOperationException("Tried to Grow when Fill would have worked.");
 }
Esempio n. 9
0
 internal ItcStamp(ItcId aId, ItcEvent aEvent)
 {
     iId = aId;
     iEvent = aEvent;
 }
Esempio n. 10
0
File: ItcId.cs Progetto: weeble/ohos
 internal abstract ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost);
Esempio n. 11
0
File: ItcId.cs Progetto: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return ItcEvent.Single(aEvent.Max);
 }
Esempio n. 12
0
File: ItcId.cs Progetto: weeble/ohos
 public abstract ItcEvent Fill(ItcEvent aEvent);
Esempio n. 13
0
File: ItcId.cs Progetto: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     throw new InvalidOperationException("Anonymous clocks cannot Grow.");
 }
Esempio n. 14
0
File: ItcId.cs Progetto: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return aEvent;
 }
Esempio n. 15
0
 public abstract ItcEvent Join(ItcEvent aOther);
Esempio n. 16
0
 public static ItcStamp Anonymous(ItcEvent aEvent)
 {
     return new ItcStamp(ItcId.Zero, aEvent);
 }
Esempio n. 17
0
 public abstract bool Leq(ItcEvent aOther);
Esempio n. 18
0
File: ItcId.cs Progetto: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return aEvent.Fill(iLeft, iRight);
 }