gusucode.com > bigdata 工具箱 matlab源码程序 > bigdata/+matlab/+bigdata/+internal/+lazyeval/PassthroughProcessor.m

    %PassthroughProcessor
% Data Processor that simply passes all data forward.
%
% This exists to allow NonPartitionedOperation to do pure communication
% without processing for the case where input arguments are still
% partitioned and require to be moved to a single worker.

%   Copyright 2016 The MathWorks, Inc.

classdef (Sealed) PassthroughProcessor < matlab.bigdata.internal.executor.DataProcessor
    % Properties overridden in the DataProcessor interface.
    properties (SetAccess = private)
        IsFinished = false;
        IsMoreInputRequired = true(0, 1);
    end
    
    methods (Static)
        % Create a data processor factory that can be used by the execution
        % environment to construct instances of this class.
        function factory = createFactory()
            factory = @createPassthroughProcessor;
            function dataProcessor = createPassthroughProcessor(~)
                import matlab.bigdata.internal.lazyeval.PassthroughProcessor;
                
                dataProcessor = PassthroughProcessor();
            end
        end
    end
    
    % Methods overridden in the DataProcessor interface.
    methods
        function data = process(obj, isLastOfInput, data)
            %PROCESS Perform the next iteration of processing
            
            obj.IsFinished = isLastOfInput;
            obj.IsMoreInputRequired = ~isLastOfInput;
        end
    end
    
    methods (Access = private)
        % Private constructor for factory method.
        function obj = PassthroughProcessor()
        end
    end
end