%IFevalQueueImpl Interface for the implementation classes held on to by the
%parallel.FevalQueue

% Copyright 2021 The MathWorks, Inc.

classdef (Abstract) IFevalQueueImpl < handle
    
    methods (Abstract, Access = {?parallel.FevalQueue, ?parallel.internal.queue.IFevalQueueImpl})

        % Implementaion of parfeval/parfevalOnAll, submit function for
        % execution on worker.
        t = parfeval(obj, parentQueue, fcn, numArgsOut, varargin)
        bt = parfevalOnAll(obj, parentQueue, fcn, numArgsOut, varargin)

        % Retrieve the specified futures
        taskVector =  getFuturesInState(obj, parentQueue, state)
        f = getFutureByID(obj, parentQueue, id)

        % Enable/disable the hidden parallel.FevalQueue FutureCompleted
        % event, used by parsim
        wasEnabled = toggleCallbacks(obj, newValue)
        
        % Should be called from the java/cpp layer after a future completes.
        notifyFutureCompleted(obj, taskId)
        
        % Enable the QueueFinishDispatcher, and add/remove functions to be
        % dispatched on future completion. Used by afterEach/All.
        turnOnQueueFinishedDispatcher(obj)
        addFuncToBeDispatchedOnFinish(obj, ID, UID, func_handle)
        removeFuncToBeDispatchedOnFinish(obj, ID, UID)
    end
end

