Opc.Ua.Server.Session.SaveHistoryContinuationPoint C# (CSharp) Method

SaveHistoryContinuationPoint() public method

Saves a continuation point used for historical reads.
If the continuationPoint implements IDisposable it will be disposed when the Session is closed or discarded.
public SaveHistoryContinuationPoint ( System.Guid id, object continuationPoint ) : void
id System.Guid The identifier for the continuation point.
continuationPoint object The continuation point.
return void
        public void SaveHistoryContinuationPoint(Guid id, object continuationPoint)
        {
            if (continuationPoint == null) throw new ArgumentNullException("continuationPoint");

            lock (m_lock)
            {
                if (m_historyContinuationPoints == null)
                {
                    m_historyContinuationPoints = new List<HistoryContinuationPoint>();
                }

                // remove existing continuation point if space needed.
                while (m_historyContinuationPoints.Count >= m_maxHistoryContinuationPoints)
                {
                    HistoryContinuationPoint oldCP = m_historyContinuationPoints[0];
                    m_historyContinuationPoints.RemoveAt(0);
                    Utils.SilentDispose(oldCP.Value);
                }

                // create the cp.
                HistoryContinuationPoint cp = new HistoryContinuationPoint();

                cp.Id = id;
                cp.Value = continuationPoint;
                cp.Timestamp = DateTime.UtcNow;

                m_historyContinuationPoints.Add(cp);
            }
        }