Exemplo n.º 1
0
            /// <summary>
            /// Applies pending state, which makes this pending state unpending.
            /// </summary>
            public void ApplyPendingState(DirtyNodeTracker tracker)
            {
                if (!IsStillPending)
                {
                    return;
                }

                foreach (var cleanNode in CleanNodes)
                {
                    tracker.MarkNodeClean(cleanNode);
                }

                // Perpetually dirty nodes must be marked first, so that the materialization can be marked later, see MarkNodeMaterialized.
                foreach (var perpetuallyDirtyNode in PerpetuallyDirtyNodes)
                {
                    tracker.MarkNodePerpetuallyDirty(perpetuallyDirtyNode);

                    // Mark perpetually dirty node clean first, so we can dirty it later.
                    tracker.MarkNodeClean(perpetuallyDirtyNode);
                }

                foreach (var materializedNode in MaterializedNodes)
                {
                    tracker.MarkNodeMaterialized(materializedNode);
                }

                // Dirty all perpetually dirty nodes and their downstream.
                tracker.MarkNodesDirty(PerpetuallyDirtyNodes);

                IsStillPending = false;
            }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for build set calculator.
        /// </summary>
        /// <param name="loggingContext">Logging context.</param>
        /// <param name="graph">Pip graph.</param>
        /// <param name="dirtyNodeTracker">Dirty node tracker.</param>
        /// <param name="counters">Counter collection.</param>
        protected BuildSetCalculator(
            LoggingContext loggingContext,
            DirectedGraph graph,
            DirtyNodeTracker dirtyNodeTracker,
            CounterCollection<PipExecutorCounter> counters)
        {
            Contract.Requires(loggingContext != null);
            Contract.Requires(graph != null);
            Contract.Requires(counters != null);

            m_loggingContext = loggingContext;
            m_graph = graph;
            m_visitor = new NodeVisitor(graph);
            m_dirtyNodeTracker = dirtyNodeTracker;
            m_counters = counters;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates an instance of <see cref="DirtyNodeTrackerSerializedState"/>.
 /// </summary>
 public DirtyNodeTrackerSerializedState(DirtyNodeTracker dirtyNodeTracker)
     : this(dirtyNodeTracker.DirtyNodes, dirtyNodeTracker.MaterializedNodes, dirtyNodeTracker.PerpetualDirtyNodes)
 {
     Contract.Requires(dirtyNodeTracker != null);
 }