public void OnBegunInterval(UInt64 ctxId, Interval iv) { StreamingObjectInterval siv = (StreamingObjectInterval)iv; RailTail tail = GetRailIdForPath(ctxId, siv.Filename); lock (m_log.IntervalTree) { m_log.IntervalTree.AddInterval(tail.id, iv); if (tail.lastIv != null) { throw new ApplicationException("blasd2"); } tail.lastIv = iv; } }
public void OnFinalisedInterval(UInt64 ctxId, Interval iv, bool isModification) { if (iv.EndUs == Int64.MaxValue) { throw new ApplicationException("bleurgh"); } StreamingObjectInterval siv = (StreamingObjectInterval)iv; RailTail tail = GetRailIdForPath(ctxId, siv.Filename); lock (m_log.IntervalTree) { if (tail.lastIv == iv) { tail.lastIv = null; } else { m_log.IntervalTree.AddInterval(tail.id, iv); } } }
private RailTail GetRailIdForPath(UInt64 ctxId, string path) { RailTail t = null; if (m_rails.ContainsKey(ctxId)) { t = m_rails[ctxId]; } else { lock (m_log.IntervalTree) { int railId = m_log.IntervalTree.AddRail(path); t = new RailTail(); t.id = railId; m_rails.Add(ctxId, t); m_log.IntervalTree.AddRailToGroup(railId, m_groupId); } } return(t); }