diff m-toolbox/classes/@ltpda_uoh/testCallerIsMethod.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@ltpda_uoh/testCallerIsMethod.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,33 @@
+% TESTCALLERISMETHOD hidden static method which tests the 'internal' command of a LTPDA-function.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: TESTCALLERISMETHOD hidden static method which tests the 'internal'
+%              command of a LTPDA-function. This means for example that the
+%              method doesn't add history to the object.
+%
+% CALL:        'normal' command
+%                 out = ltpda_uoh.testCallerIsMethod(@fcn, arg1, arg2, ...);
+%
+%              modifier command
+%                 ltpda_uoh.testCallerIsMethod(@fcn, arg1, arg2, ...);
+%
+% INPUTS:      fcn:  Function name you want to test
+%              args: Input arguments for the function
+%
+% VERSION:     $Id: testCallerIsMethod.m,v 1.2 2011/04/19 10:40:16 ingo Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function out = testCallerIsMethod(varargin)
+  
+  fcn = varargin{1};
+  args = varargin(2:end);
+  
+  if nargout >= 1
+    out = fcn(args{:});
+  else
+    fcn(args{:});
+    out = varargin{1};
+  end
+  
+end