Ejemplo n.º 1
0
 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));
         }
     }
 }
Ejemplo n.º 2
0
 public void AddTick(ref TickImpl tick)
 {
     if (!isReadable)
     {
         buffer[writeIndex] = tick;
         writeIndex++;
     }
     if (writeIndex >= buffer.Length)
     {
         readIndex  = 0;
         isReadable = true;
     }
 }
Ejemplo n.º 3
0
 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.");
     }
 }
Ejemplo n.º 4
0
 public bool Equals(TickImpl other)
 {
     return(CompareTo(ref other) == 0);
 }
Ejemplo n.º 5
0
        public override bool Equals(object obj)
        {
            TickImpl other = (TickImpl)obj;

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