Example #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));
 }
Example #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);
 }
Example #3
0
 public override bool Leq(ItcEvent aOther)
 {
     return iValue <= aOther.Min;
 }
Example #4
0
 public override ItcEvent Join(ItcEvent aOther)
 {
     return Tree(
         0,
         Left.Join(aOther.Left),
         Right.Join(aOther.Right));
 }
Example #5
0
 public override bool Leq(ItcEvent aOther)
 {
     return
         iValue <= aOther.Min &&
         Left.Leq(aOther.Left) &&
         Right.Leq(aOther.Right);
 }
Example #6
0
File: ItcId.cs Project: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     return aEvent.InternalGrow(iLeft, iRight, out aCost);
 }
Example #7
0
 public ItcEventTree(int aValue, ItcEvent aLeft, ItcEvent aRight)
     : base(aValue)
 {
     iLeft = aLeft;
     iRight = aRight;
 }
Example #8
0
File: ItcId.cs Project: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     throw new InvalidOperationException("Tried to Grow when Fill would have worked.");
 }
Example #9
0
 internal ItcStamp(ItcId aId, ItcEvent aEvent)
 {
     iId = aId;
     iEvent = aEvent;
 }
Example #10
0
File: ItcId.cs Project: weeble/ohos
 internal abstract ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost);
Example #11
0
File: ItcId.cs Project: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return ItcEvent.Single(aEvent.Max);
 }
Example #12
0
File: ItcId.cs Project: weeble/ohos
 public abstract ItcEvent Fill(ItcEvent aEvent);
Example #13
0
File: ItcId.cs Project: weeble/ohos
 internal override ItcEvent InternalGrow(ItcEvent.ItcEventTree aEvent, out long aCost)
 {
     throw new InvalidOperationException("Anonymous clocks cannot Grow.");
 }
Example #14
0
File: ItcId.cs Project: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return aEvent;
 }
Example #15
0
 public abstract ItcEvent Join(ItcEvent aOther);
Example #16
0
 public static ItcStamp Anonymous(ItcEvent aEvent)
 {
     return new ItcStamp(ItcId.Zero, aEvent);
 }
Example #17
0
 public abstract bool Leq(ItcEvent aOther);
Example #18
0
File: ItcId.cs Project: weeble/ohos
 public override ItcEvent Fill(ItcEvent aEvent)
 {
     return aEvent.Fill(iLeft, iRight);
 }