view m-toolbox/m/etc/ltpda_run_method.m @ 24:056f8e1e995e database-connection-manager

Properly record history in fromRepository constructors
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

% LTPDA_RUN_METHOD runs an LTPDA method inside a script environment to
% ensure that callerIsMethod returns false and history will always be
% added. This can be useful when objects created deep inside a call-stack
% need to have history added.
% 
% CALL
%         out = ltpda_run_method(fcn, varargin)
% 
% VERSION: $Id: ltpda_run_method.m,v 1.2 2011/04/09 07:38:59 hewitson Exp $
% 
function varargout = ltpda_run_method(fcn, varargin)
  
  if nargout > 0
    out = feval(fcn, varargin{:}); 
    varargout = utils.helper.setoutputs(nargout, out);
  else
    feval(fcn, varargin{:});
  end
  
end