function varargout = isInputDirectFeedthrough(obj, varargin)
%MATLAB Code Generation Library function.
% Implement isInputDirectFeedthrough function for System objects.

%   Copyright 2011-2014 The MathWorks, Inc.
%#codegen

coder.inline('always');

eml_invariant(nargin >= 1, ...
    'MATLAB:system:codeGenNoSystemObjectInput', 'isInputDirectFeedthrough');

checkSystemObjectInput(obj, 'isInputDirectFeedthrough');

coder.extrinsic('eml_try_catch');

[errId, errMsg, numinputs] = coder.const(@eml_try_catch,'getNumInputs', eml_sea_get_obj(obj));
eml_lib_assert(isempty(errMsg), errId, errMsg);

eml_invariant(coder.const(isempty(varargin) || length(varargin)==numinputs),...
    'MATLAB:system:incorrectDirectFeedthroughArguments', 0, numinputs);  

outs = cell(1, numinputs);
if eml_ambiguous_types || eml_ambiguous_complexity
    for ii=coder.unroll(1:numinputs)
        outs{ii} = false;
    end
else
  if numinputs == 0
    varargout{1} = logical([]);
  else
	[errId, errMsg, outs{1:numinputs}] = coder.const(@eml_try_catch,'isInputDirectFeedthrough', eml_sea_get_obj(obj));
  end

end

for i=coder.unroll(1:numinputs)
    if isempty(outs{i})
        varargout{i} = true;
    else
        varargout{i} = outs{i};
    end
end

eml_lib_assert(isempty(errMsg), errId, errMsg);
