classdef ComponentBoundaryValidation < handle
    % COMPONENTBOUNDARYVALIDATION
    %
    %   Proxy class to handle validation of the component boundary
    %   interface for SIL/PIL.

%   Copyright 2018 The MathWorks, Inc.

    properties (SetAccess = private, GetAccess = public)
        IsValid = true;
    end
    
    properties (Access = private)
        % If true, we throw an error.  If false, we just set IsValid false.
        NeedHardValidation logical;
    end
    
    methods (Access = public)
        function obj = ComponentBoundaryValidation(needHardValidation)
            % COMPONENTBOUNDARYVALIDATION
            obj.NeedHardValidation = needHardValidation;
        end
        
        function validationError(obj, varargin)
            % VALIDATIONERROR
            if obj.NeedHardValidation
                rtw.pil.ProductInfo.error(varargin{:});
            else
                obj.IsValid = false;
            end
        end
    end
    
end
