Mercurial > hg > ltpda
comparison m-toolbox/classes/@provenance/provenance.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % PROVENANCE constructors for provenance class. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: PROVENANCE constructors for provenance class. | |
5 % | |
6 % SUPERCLASSES: ltpda_nuo < ltpda_obj | |
7 % | |
8 % CONSTRUCTORS: | |
9 % | |
10 % p = provenance(); - creates an empty provenance object | |
11 % p = provenance('creator'); - creates a provenance object with defined user | |
12 % | |
13 % VERSION: $Id: provenance.m,v 1.60 2011/03/28 17:02:28 ingo Exp $ | |
14 % | |
15 % SEE ALSO: ltpda_obj, ltpda_nuo | |
16 % | |
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
18 | |
19 classdef (Hidden = true) provenance < ltpda_nuo | |
20 | |
21 %------------------------------------------------ | |
22 %---------- Private read-only Properties -------- | |
23 %------------------------------------------------ | |
24 properties (SetAccess = private) | |
25 creator = char(java.lang.System.getProperties.getProperty('user.name')); % current user of the LTPDA toolbox | |
26 ip = char(getHostAddress(java.net.InetAddress.getLocalHost)); % ip address of the creator | |
27 hostname = char(getHostName(java.net.InetAddress.getLocalHost)); % hostname of the creator | |
28 os = computer; % used system of the creator | |
29 matlab_version = getappdata(0, 'matlab_version'); % MATLAB version | |
30 sigproc_version = getappdata(0, 'sigproc_version'); % Signal Processing Toolbox version | |
31 symbolic_math_version = getappdata(0, 'symbolic_math_version'); % Symbolic Math Toolbox version | |
32 optimization_version = getappdata(0, 'optimization_version'); % Optimization Toolbox version | |
33 database_version = getappdata(0, 'database_version'); % Database Toolbox version | |
34 control_version = getappdata(0, 'control_version'); % Control System Toolbox version | |
35 ltpda_version = getappdata(0, 'ltpda_version'); % LTPDA toolbox version | |
36 end | |
37 | |
38 properties (SetAccess = protected) | |
39 end | |
40 | |
41 %------------------------------------------------ | |
42 %-------- Declaration of public methods -------- | |
43 %------------------------------------------------ | |
44 methods | |
45 | |
46 %------------------------------------------------ | |
47 %-------- Property rules -------- | |
48 %------------------------------------------------ | |
49 | |
50 %---------------------------- | |
51 % Constructor | |
52 %---------------------------- | |
53 function obj = provenance(varargin) | |
54 | |
55 switch nargin | |
56 case 0 | |
57 case 1 | |
58 if isstruct(varargin{1}) | |
59 %%%%%%%%%% prov = provenance(structure) %%%%%%%%%% | |
60 obj = fromStruct(obj, varargin{1}); | |
61 | |
62 elseif ischar(varargin{1}) | |
63 obj.creator = varargin{1}; | |
64 | |
65 elseif isa(varargin{1}, 'provenance') | |
66 % utils.helper.msg(msg.OPROC1, 'copy constructor'); | |
67 obj = copy(varargin{1}, 1); | |
68 else | |
69 error('### Unknown constructor'); | |
70 end | |
71 | |
72 case 2 | |
73 if isa(varargin{1}, 'org.apache.xerces.dom.DeferredElementImpl') && ... | |
74 isa(varargin{2}, 'history') | |
75 %%%%%%%%%% obj = provenance(DOM node, history-objects) %%%%%%%%%% | |
76 obj = fromDom(obj, varargin{1}, varargin{2}); | |
77 else | |
78 error('### Unknown constructor method for two inputs.'); | |
79 end | |
80 end | |
81 | |
82 end % End of constructor | |
83 | |
84 end % End public methods | |
85 | |
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
87 % Methods (public) % | |
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
89 | |
90 methods (Access = public) | |
91 varargout = copy(varargin) | |
92 end | |
93 | |
94 methods (Hidden = true) | |
95 varargout = attachToDom(varargin) | |
96 end | |
97 | |
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
99 % Methods (protected) % | |
100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
101 | |
102 methods (Access = protected) | |
103 varargout = fromStruct(varargin) | |
104 varargout = fromDom(varargin) | |
105 end | |
106 | |
107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
108 % Methods (private) % | |
109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
110 | |
111 methods (Access = private) | |
112 end | |
113 | |
114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
115 % Methods (Static, Public) % | |
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
117 | |
118 methods (Static = true) | |
119 | |
120 function out = VEROUT() | |
121 out = '$Id: provenance.m,v 1.60 2011/03/28 17:02:28 ingo Exp $'; | |
122 end | |
123 | |
124 function ii = getInfo(varargin) | |
125 ii = utils.helper.generic_getInfo(varargin{:}, 'provenance'); | |
126 end | |
127 | |
128 function out = SETS() | |
129 out = {'Default'}; | |
130 end | |
131 | |
132 function out = getDefaultPlist(set) | |
133 switch lower(set) | |
134 case 'default' | |
135 out = plist(); | |
136 otherwise | |
137 error('### Unknown set [%s]', set); | |
138 end | |
139 end | |
140 | |
141 function obj = initObjectWithSize(n,m) | |
142 obj = provenance.newarray([n m]); | |
143 end | |
144 | |
145 end % End static methods | |
146 | |
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
148 % Methods (Static, Private) % | |
149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
150 | |
151 methods (Static = true, Access = private) | |
152 end % End static private methods | |
153 | |
154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
155 % Methods (static, hidden) % | |
156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
157 | |
158 methods (Static = true, Hidden = true) | |
159 varargout = loadobj(varargin) | |
160 varargout = setFromEncodedInfo(varargin) | |
161 varargout = update_struct(varargin) | |
162 end | |
163 | |
164 end % End classdef | |
165 |