classdef RunData
    %RUNDATA class to hold run artifacts for a Pipeline object
    %
    % RunData properties:
    % CancelActive          - Logical specifying whether Pipeline.cancel has been called
    % BlocksEvaluated       - Logical array specifying which blocks have been evaluated
    % BlocksCompleted       - Logical array specifying which blocks have been Completed
    % PipelineCompleted     - Logical specifying if a pipeline run has
    %                         completed. This flipped to true in the
    %                         pipeline at the first instance where all
    %                         blocks are complete in order to send a single
    %                         "PipelineRunFinish" dispatch
    % BlocksToRun           - Vector of numeric indices to specify which blocks to run
    % ProcessQueues         - Dictionary with ProcessQueues as values and Blocks as keys
    %
    % RunData Transient properties:
    % CompletionQueue       - DataQueue used to check if a pipeline run has finished
    % PropagationFutures    - Future for ProcessQueues to propagateAndRunDownstream once finished
    % ParallelPool          - parallel pool used during the pipeline run

    properties
        CancelActive(1,1) logical = false

        BlocksEvaluated logical = logical.empty

        BlocksCompleted logical = logical.empty

        PipelineCompleted(1,1) logical = true

        BlocksToRun = []

        ProcessQueues = dictionary(bioinfo.pipeline.Block.empty, bioinfo.pipeline.internal.ProcessQueue.empty);

        UUID(1,1) string
    end

    properties (Transient)
        CompletionQueue parallel.pool.DataQueue = parallel.pool.DataQueue.empty

        PropagationFutures parallel.Future = parallel.AfterAllFuture.empty

        ParallelPool = []
    end

    methods
        function obj = RunData()
            obj.UUID = matlab.lang.internal.uuid;
        end
    end
end