% SLCOVERAGE.SELECTOR methods:
%   slcoverage.Selector.allSelectors(blockH) 
%       returns all selectors for a block
%   slcoverage.Selector.allSelectors(blockH, 'Type', selectorType) 
%       returns all selectors specified by selectorType
%   slcoverage.Selector.allSelectors(blockH, 'Description', text) 
%       returns all selectors where the Description field contains text
%
% See also: SLCOVERAGE.FILTERRULE, SLCOVERAGE.FILTER

% Copyright 2017-2018 The MathWorks, Inc.

classdef Selector < handle & matlab.mixin.Heterogeneous
properties (Constant, Hidden)
    SupportedSelectorTypes = {...
        'slcoverage.BlockSelectorType',...
        'slcoverage.MetricSelectorType',...
        'slcoverage.SFcnSelectorType',...
        'slcoverage.CodeSelectorType'...
        }
    SupportedXILModes = {'xil', 'sil', 'pil', 'modelrefxil', 'modelrefsil', 'modelrefpil'}
end
properties (SetAccess = private)
    Description = 'N/A' 
    Type = []
    Id = ''
    ConstructorCode = ''
end
properties (Hidden = true)
    SId = ''
end
%===================
methods
    function this = Selector(sid, type, id)
        this.Type = type;
        this.SId = sid;
        this.Id = id;
    end
end
%===================
methods  
    function setDescription(this, description)
         this.Description = description;
    end
end
%===================
methods  (Access = protected)    
    function setConstructorCode(this, codeStr)
         this.ConstructorCode = codeStr;
    end
end

%===================
methods  (Static = true, Access = ?slcoverage.Filter)
    [selector, predefRules] = possibleCodeSelector(sid, varargin)
end

%===================
methods  (Static = true, Access = protected)    
    selector = createSelector(id)
end

%===================
methods  (Static = true)    
    s = allSelectors(blockH, varargin)
    codeTrFile = checkCodeCompile(sid, simMode)
end

end
