Home > classes > @provenance > provenance.m

provenance

PURPOSE ^

PROVENANCE constructors for provenance class.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 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.39 2008/08/25 11:16:34 ingo Exp $

 HISTORY:      07-05-2007 M Hewitson
                  Creation

 SEE ALSO:     ltpda_obj, ltpda_nuo

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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.39 2008/08/25 11:16:34 ingo 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   %------------------------------------------------
0080   %-------- Declaration of public methods --------
0081   %------------------------------------------------
0082   methods
0083 
0084     %------------------------------------------------
0085     %-------- Property rules                 --------
0086     %------------------------------------------------
0087     function obj = set.creator(obj,val)
0088       if ~ischar(val)
0089         error('### The <creator> property should be a character array.');
0090       end
0091       obj.creator = val;
0092     end
0093     function obj = set.ip(obj,val)
0094       if ~ischar(val)
0095         error('### The <ip> property should be a character array.');
0096       end
0097       obj.ip = val;
0098     end
0099     function obj = set.hostname(obj,val)
0100       if ~ischar(val)
0101         error('### The <hostname> property should be a character array.');
0102       end
0103       obj.hostname = val;
0104     end
0105     function obj = set.os(obj,val)
0106       if ~ischar(val)
0107         error('### The <os> property should be a string.');
0108       end
0109       obj.os = val;
0110     end
0111     function obj = set.matlab_version(obj,val)
0112       if ~ischar(val)
0113         error('### The <matlab_version> property should be a string.');
0114       end
0115       obj.matlab_version = val;
0116     end
0117     function obj = set.sigproc_version(obj,val)
0118       if ~ischar(val)
0119         error('### The <sigproc_version> property should be a string.');
0120       end
0121       obj.sigproc_version = val;
0122     end
0123     function obj = set.symbolic_math_version(obj,val)
0124       if ~ischar(val)
0125         error('### The <symbolic_math_version> property should be a string.');
0126       end
0127       obj.symbolic_math_version = val;
0128     end
0129     function obj = set.ltpda_version(obj,val)
0130       if ~ischar(val)
0131         error('### The <ltpda_version> property should be a string.');
0132       end
0133       obj.ltpda_version = val;
0134     end
0135 
0136     %----------------------------
0137     % Constructor
0138     %----------------------------
0139     function obj = provenance(varargin)
0140 
0141       import utils.const.*
0142       utils.helper.msg(msg.OMNAME, 'running %s/%s', mfilename('class'), mfilename);
0143       
0144       %%% Call superclass
0145       obj = obj@ltpda_nuo(varargin{:});
0146 
0147       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0148       %%% Exept for a struct as an input
0149       if ~(nargin == 1 && isstruct(varargin{1}))
0150         % Set version
0151         obj.setVersion('$Id: provenance.m,v 1.39 2008/08/25 11:16:34 ingo Exp $');
0152       end
0153 
0154       if nargin == 1
0155         if isstruct(varargin{1})
0156           utils.helper.msg(msg.OPROC1, 'constructing from struct');
0157           %%%%%%%%%%   prov = provenance(structure)   %%%%%%%%%%
0158           %%%%%%%%%%   necessary for readxml   %%%%%%%%%%
0159 
0160           %%% Set properties which are declared in this class
0161           prov_struc = varargin{1};
0162 
0163           obj.creator               = prov_struc.creator;
0164           obj.ip                    = prov_struc.ip;
0165           obj.hostname              = prov_struc.hostname;
0166           obj.os                    = prov_struc.os;
0167           obj.matlab_version        = prov_struc.matlab_version;
0168           obj.sigproc_version       = prov_struc.sigproc_version;
0169           obj.symbolic_math_version = prov_struc.symbolic_math_version;
0170           obj.ltpda_version         = prov_struc.ltpda_version;
0171 
0172         elseif ischar(varargin{1})
0173           obj.creator = varargin{1};
0174         elseif isa(varargin{1}, 'provenance')
0175           utils.helper.msg(msg.OPROC1, 'copy constructor');
0176           obj = copy(varargin{1}, 1);
0177         else
0178           error('### Unknown constructor');
0179         end
0180       end
0181 
0182     end % End of constructor
0183 
0184   end % End public methods
0185 
0186   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0187   %                               Methods (public)                            %
0188   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0189 
0190   methods (Access = public)
0191     varargout = copy(varargin)
0192   end
0193 
0194   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0195   %                              Methods (protected)                          %
0196   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0197 
0198   methods (Access = protected)
0199   end
0200 
0201   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0202   %                          Methods (Static, Public)                         %
0203   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0204 
0205   methods (Static = true)
0206 
0207     varargout = update_struct(varargin);
0208 
0209     function out = VEROUT()
0210       out = '$Id: provenance.m,v 1.39 2008/08/25 11:16:34 ingo Exp $';
0211     end
0212 
0213     function ii = getInfo(varargin)
0214       ii = utils.helper.generic_getInfo(varargin{:}, 'provenance');
0215     end
0216 
0217     function out = SETS()
0218       out = {'Default'};
0219     end
0220 
0221     function out = getDefaultPlist(set)
0222       switch set
0223         case 'Default'
0224           out = plist();
0225         otherwise
0226           out = plist();
0227       end
0228     end
0229 
0230   end % End static methods
0231 
0232   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0233   %                          Methods (Static, Private)                        %
0234   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0235 
0236   methods (Static = true, Access = private)
0237   end % End static private methods
0238 
0239 end % End classdef
0240

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003