internal void Refresh()
        {
            lock (m_synchronizer)
            {
                Algorithm.Swap(ref m_first, ref m_second);
                m_first.Clear();
            }
            foreach (var element in m_second)
            {
                m_quotes.Enqueue(element);
                m_last = element;
            }
            long now = EnvironmentEx.GetTickCountEx();

            for (; m_quotes.Count > 0;)
            {
                QuoteEx entry = m_quotes.Peek();
                long    delta = (now - entry.Time);
                if (delta > m_intervalInMs)
                {
                    m_quotes.Dequeue();
                }
                else
                {
                    break;
                }
            }
            m_time = now;
        }
 internal void Add(Quote quote)
 {
     lock (m_synchronizer)
     {
         long    now   = EnvironmentEx.GetTickCountEx();
         QuoteEx entry = new QuoteEx(now, quote);
         m_first.Add(entry);
     }
 }
Ejemplo n.º 3
0
 internal QuoteEx(Quote quote) : this()
 {
     m_time  = EnvironmentEx.GetTickCountEx();
     m_quote = quote;
 }