classdef InstrumentationStrategy < fxptds.RangeAggregation.PrecisionExtractionStrategy
    %% INSTRUMENTATIONSTRATEGY class
    % This class implements a strategy to extract precision data from instrumentation
    % If a block has active instrumentation and the field PrecisionHistogramData
    % is populated then this strategy will return the histogram bins. Otherwise
    % the strategy delegates to the next strategy in the chain.
    
    % Copyright 2018 The MathWorks, Inc.
    
    methods
        function [data, isWholeNumber] = getData(this, member)
            % try to get the precision histogram data
            data = member.PrecisionHistogramData;
            
            if isempty(member.WholeNumber)
                [data, isWholeNumber] = this.nextStrategy.getData(member);
            else
                isWholeNumber = member.WholeNumber;
            end
            
        end
        
    end
end

