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