public SignatureCompressor()
 {
     currentTick = new TickImpl();
     ResetCounters();
     if (shortValueCompression)
     {
         shortValueCounts = new List <ByteCount>(256 * 256);
         for (int i = 0; i < shortValueCounts.Capacity; i++)
         {
             shortValueCounts.Add(new ByteCount(i, 0));
         }
     }
 }
 public void AddTick(ref TickImpl tick)
 {
     if (!isReadable)
     {
         buffer[writeIndex] = tick;
         writeIndex++;
     }
     if (writeIndex >= buffer.Length)
     {
         readIndex  = 0;
         isReadable = true;
     }
 }
 public TickImpl NextTick()
 {
     if (isReadable)
     {
         TickImpl tick = buffer[readIndex];
         readIndex++;
         if (readIndex >= buffer.Length || readIndex >= writeIndex)
         {
             writeIndex = 0;
             isReadable = false;
         }
         return(tick);
     }
     else
     {
         throw new Exception("TickBuffer overflow.");
     }
 }
Exemple #4
0
 public bool Equals(TickImpl other)
 {
     return(CompareTo(ref other) == 0);
 }
Exemple #5
0
        public override bool Equals(object obj)
        {
            TickImpl other = (TickImpl)obj;

            return(CompareTo(ref other) == 0);
        }