Contains the Pending Deletions for the ArchiveList{TKey,TValue}. This class is thread safe.
Inheritance: GSF.Diagnostics.DisposableLoggingClassBase
コード例 #1
0
        /// <summary>
        /// Creates an ArchiveList
        /// </summary>
        /// <param name="settings">The settings for the archive list. Null will revert to a default setting.</param>
        public ArchiveList(ArchiveListSettings settings = null)
        {
            if (settings == null)
            {
                settings = new ArchiveListSettings();
            }
            m_settings = settings.CloneReadonly();
            m_settings.Validate();

            m_syncRoot                            = new object();
            m_fileSummaries                       = new SortedList <Guid, ArchiveTableSummary <TKey, TValue> >();
            m_allSnapshots                        = new WeakList <ArchiveListSnapshot <TKey, TValue> >();
            m_listLog                             = new ArchiveListLog(m_settings.LogSettings);
            m_filesToDelete                       = new List <SortedTreeTable <TKey, TValue> >();
            m_filesToDispose                      = new List <SortedTreeTable <TKey, TValue> >();
            m_processRemovals                     = new ScheduledTask(ThreadingMode.DedicatedBackground);
            m_processRemovals.Running            += ProcessRemovals_Running;
            m_processRemovals.Disposing          += ProcessRemovals_Disposing;
            m_processRemovals.UnhandledException += ProcessRemovals_UnhandledException;

            AttachFileOrPath(m_settings.ImportPaths);

            HashSet <Guid> files = new HashSet <Guid>(m_filesToDelete.Select(x => x.ArchiveId));

            m_listLog.ClearCompletedLogs(files);
        }