PROVENANCE constructors for provenance class. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: PROVENANCE constructors for provenance class. SUPER CLASSES: ltpda_nuo < ltpda_obj PROPERTIES: Inherit Properties (read only) version - cvs-version string. Protected Properties (read only) creator - current user of the LTPDA toolbox ip - ip address of the creator hostname - hostname of the creator os - used system of the creator matlab_version - MATLAB version sigproc_version - Signal Processing Toolbox version symbolic_math_version - Symbolic Math Toolbox version ltpda_version - LTPDA Toolbox version version - version of the constructor PROVENANCE METHODS: Defined Abstract methods: char - returns one character string which represents the object copy - copies an object display - displays an object update_struct - updates a object structure to the current tbx-version Public methods: string - writes a command string that can be used to recreate the object CONSTRUCTORS: p = provenance(); - creates an empty provenance object p = provenance('creator'); - creates aprovenance object with defiened user M-FILE INFO: The following call returns an minfo object that contains information about the AO constructor: >> info = provenance.getInfo or >> info = provenance.getInfo('provenance') You can get information about class methods by calling: >> info = provenance.getInfo(method) e.g. >> info = provenance.getInfo('eq') You can also restrict the sets of parameters contained in the minfo object by calling: >> info = provenance.getInfo(method, set) e.g. >> info = provenance.getInfo('provenance', 'Set') VERSION: $Id: provenance.m,v 1.40 2008/09/03 16:35:40 hewitson Exp $ HISTORY: 07-05-2007 M Hewitson Creation SEE ALSO: ltpda_obj, ltpda_nuo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % PROVENANCE constructors for provenance class. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: PROVENANCE constructors for provenance class. 0005 % 0006 % SUPER CLASSES: ltpda_nuo < ltpda_obj 0007 % 0008 % PROPERTIES: 0009 % 0010 % Inherit Properties (read only) 0011 % version - cvs-version string. 0012 % 0013 % Protected Properties (read only) 0014 % creator - current user of the LTPDA toolbox 0015 % ip - ip address of the creator 0016 % hostname - hostname of the creator 0017 % os - used system of the creator 0018 % matlab_version - MATLAB version 0019 % sigproc_version - Signal Processing Toolbox version 0020 % symbolic_math_version - Symbolic Math Toolbox version 0021 % ltpda_version - LTPDA Toolbox version 0022 % version - version of the constructor 0023 % 0024 % PROVENANCE METHODS: 0025 % 0026 % Defined Abstract methods: 0027 % char - returns one character string which represents the object 0028 % copy - copies an object 0029 % display - displays an object 0030 % update_struct - updates a object structure to the current tbx-version 0031 % 0032 % Public methods: 0033 % string - writes a command string that can be used to recreate the object 0034 % 0035 % CONSTRUCTORS: 0036 % 0037 % p = provenance(); - creates an empty provenance object 0038 % p = provenance('creator'); - creates aprovenance object with defiened user 0039 % 0040 % M-FILE INFO: The following call returns an minfo object that contains 0041 % information about the AO constructor: 0042 % >> info = provenance.getInfo 0043 % or >> info = provenance.getInfo('provenance') 0044 % 0045 % You can get information about class methods by calling: 0046 % >> info = provenance.getInfo(method) 0047 % e.g. >> info = provenance.getInfo('eq') 0048 % 0049 % You can also restrict the sets of parameters contained in 0050 % the minfo object by calling: 0051 % >> info = provenance.getInfo(method, set) 0052 % e.g. >> info = provenance.getInfo('provenance', 'Set') 0053 % 0054 % VERSION: $Id: provenance.m,v 1.40 2008/09/03 16:35:40 hewitson Exp $ 0055 % 0056 % HISTORY: 07-05-2007 M Hewitson 0057 % Creation 0058 % 0059 % SEE ALSO: ltpda_obj, ltpda_nuo 0060 % 0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0062 0063 classdef provenance < ltpda_nuo 0064 0065 %------------------------------------------------ 0066 %---------- Private read-only Properties -------- 0067 %------------------------------------------------ 0068 properties (SetAccess = private) 0069 creator = char(java.lang.System.getProperties.getProperty('user.name')); 0070 ip = char(getHostAddress(java.net.InetAddress.getLocalHost));; 0071 hostname = char(getHostName(java.net.InetAddress.getLocalHost)); 0072 os = computer; 0073 matlab_version = getappdata(0, 'matlab_version'); 0074 sigproc_version = getappdata(0, 'sigproc_version'); 0075 symbolic_math_version = getappdata(0, 'ltpda_symbolic_math'); 0076 ltpda_version = getappdata(0, 'ltpda_version'); 0077 end 0078 0079 properties (SetAccess = protected) 0080 version = '$Id: provenance.m,v 1.40 2008/09/03 16:35:40 hewitson Exp $'; 0081 end 0082 0083 %------------------------------------------------ 0084 %-------- Declaration of public methods -------- 0085 %------------------------------------------------ 0086 methods 0087 0088 %------------------------------------------------ 0089 %-------- Property rules -------- 0090 %------------------------------------------------ 0091 0092 %---------------------------- 0093 % Constructor 0094 %---------------------------- 0095 function obj = provenance(varargin) 0096 0097 import utils.const.* 0098 utils.helper.msg(msg.OMNAME, 'running %s/%s', mfilename('class'), mfilename); 0099 0100 %%% Call superclass 0101 obj = obj@ltpda_nuo(varargin{:}); 0102 0103 %%%%%%%%%% Set dafault values %%%%%%%%%% 0104 0105 if nargin == 1 0106 if isstruct(varargin{1}) 0107 utils.helper.msg(msg.OPROC1, 'constructing from struct'); 0108 %%%%%%%%%% prov = provenance(structure) %%%%%%%%%% 0109 %%%%%%%%%% necessary for readxml %%%%%%%%%% 0110 0111 %%% Set properties which are declared in this class 0112 prov_struc = varargin{1}; 0113 0114 obj.creator = prov_struc.creator; 0115 obj.ip = prov_struc.ip; 0116 obj.hostname = prov_struc.hostname; 0117 obj.os = prov_struc.os; 0118 obj.matlab_version = prov_struc.matlab_version; 0119 obj.sigproc_version = prov_struc.sigproc_version; 0120 obj.symbolic_math_version = prov_struc.symbolic_math_version; 0121 obj.ltpda_version = prov_struc.ltpda_version; 0122 obj.version = prov_struc.version; 0123 0124 elseif ischar(varargin{1}) 0125 obj.creator = varargin{1}; 0126 elseif isa(varargin{1}, 'provenance') 0127 utils.helper.msg(msg.OPROC1, 'copy constructor'); 0128 obj = copy(varargin{1}, 1); 0129 else 0130 error('### Unknown constructor'); 0131 end 0132 end 0133 0134 end % End of constructor 0135 0136 end % End public methods 0137 0138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0139 % Methods (public) % 0140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0141 0142 methods (Access = public) 0143 varargout = copy(varargin) 0144 end 0145 0146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0147 % Methods (protected) % 0148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0149 0150 methods (Access = protected) 0151 end 0152 0153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0154 % Methods (Static, Public) % 0155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0156 0157 methods (Static = true) 0158 0159 varargout = update_struct(varargin); 0160 0161 function out = VEROUT() 0162 out = '$Id: provenance.m,v 1.40 2008/09/03 16:35:40 hewitson Exp $'; 0163 end 0164 0165 function ii = getInfo(varargin) 0166 ii = utils.helper.generic_getInfo(varargin{:}, 'provenance'); 0167 end 0168 0169 function out = SETS() 0170 out = {'Default'}; 0171 end 0172 0173 function out = getDefaultPlist(set) 0174 switch set 0175 case 'Default' 0176 out = plist(); 0177 otherwise 0178 out = plist(); 0179 end 0180 end 0181 0182 end % End static methods 0183 0184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0185 % Methods (Static, Private) % 0186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0187 0188 methods (Static = true, Access = private) 0189 end % End static private methods 0190 0191 end % End classdef 0192