public void CompareTick(TickIO tick)
 {
     tick.ToWriter(current.Memory);
     if (count > 0)
     {
         CompareMemory(current.Bytes, previous.Bytes, current.Length);
     }
 }
Esempio n. 2
0
 public void WriteTick(TickIO tickIO)
 {
     if (!isInitialized)
     {
         throw new InvalidStateException("Please call one of the Initialize() methods first.");
     }
     tickIO.ToWriter(memory);
     if (memory.Position > 5000)
     {
         WriteToFile();
     }
 }
Esempio n. 3
0
        public bool TryWriteTick(TickIO tickIO)
        {
            var result       = true;
            var tempPosition = memory.Position;

            tickIO.ToWriter(memory);
            if (tickBlockHeader.firstUtcTimeStamp == 0L)
            {
                tickBlockHeader.firstUtcTimeStamp = tickIO.lUtcTime;
            }
            if (memory.Position > blockSize)
            {
                memory.Position = tempPosition;
                memory.SetLength(tempPosition);
                result = false;
            }
            else
            {
                tickBlockHeader.lastUtcTimeStamp = tickIO.lUtcTime;
            }
            return(result);
        }
Esempio n. 4
0
 public bool TryWriteTick(TickIO tickIO)
 {
     if (!isInitialized)
     {
         throw new InvalidStateException("Please call one of the Initialize() methods first.");
     }
     TryCompleteAsyncWrite();
     if (trace)
     {
         log.Trace("Writing to file buffer: " + tickIO);
     }
     tickIO.ToWriter(memory);
     if (memory.Position > 5000)
     {
         MoveMemoryToQueue();
         TryCompleteAsyncWrite();
         if (writeFileResult == null)
         {
             writeFileResult = writeFileAction.BeginInvoke(null, null);
         }
     }
     return(true);
 }