KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Devel.m
Go to the documentation of this file.
1 
2 
3 /* (Autoinserted by mtoc++)
4  * This source code has been filtered by the mtoc++ executable,
5  * which generates code that can be processed by the doxygen documentation tool.
6  *
7  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
8  * Except for the comments, the function bodies of your M-file functions are untouched.
9  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
10  * attached source files that are highly readable by humans.
11  *
12  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
13  * the correct locations in the source code browser.
14  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
15  */
16 
17 class Devel
18  :public handle {
56  public: /* ( Dependent ) */
57 
94  public: /* ( Dependent ) */
95 
96 
97 #if 0 //mtoc++: 'set.Author'
98 function Author(value) {
99  setpref(" KERMOR_DEVEL "," author ",value);
100  }
101 
102 #endif
103 
104 
105 #if 0 //mtoc++: 'set.AuthorShort'
106 function AuthorShort(value) {
107  setpref(" KERMOR_DEVEL "," authorshort ",value);
108  }
109 
110 #endif
111 
112 
113 
114 #if 0 //mtoc++: 'get.Author'
115 function v = Author() {
116  v = getpref(" KERMOR_DEVEL "," author "," <No author set> ");
117  }
118 
119 #endif
120 
121 
122 #if 0 //mtoc++: 'get.AuthorShort'
123 function v = AuthorShort() {
124  v = getpref(" KERMOR_DEVEL "," authorshort "," <No author short set> ");
125  }
126 
127 #endif
128 
129 
130 #if 0 //mtoc++: 'get.Date'
131 function v = Date() {
132  v = datestr(now, " yyyy-mm-dd ");
133  }
134 
135 #endif
136 
137 
138  public: /* ( Static ) */ /* ( Dependent ) */
139 
140 
141  static function Develinst = Instance() {
142  inst = Devel;
143  }
153  static function setup() {
154  d = Devel.Instance;
155  fprintf(" Running KerMor developer setup...\n ");
156  str = sprintf(" Please enter your full name: ");
157  d.Author= input(str," s ");
158  str = sprintf(" Please enter your author "" s short tag: ");
159  d.AuthorShort= input(str," s ");
160  fprintf(" Finished!\n ");
161  }
171  static function newClass(name,varargin) {
172  if ~isa(name," char ")
173  error(" The class name must be a string ");
174  end
175  Devel.process(name, " template_class ", varargin[:]);
176  }
190  static function newFun(name,varargin) {
191 
192  if ~isa(name," char ")
193  error(" The class name must be a string ");
194  end
195 
196  Devel.process(name, " template_fun ", varargin[:]);
197  }
214  private: /* ( Static ) */ /* ( Dependent ) */
215 
216  static function process(name,template_file,dir) {
217  if nargin < 3
218  dir = pwd;
219  end
220  fname = fullfile(dir,[name " .m "]);
221  if exist(fname," file ")
222  error(" File %s already exists. ",fname);
223  end
224 
225  /* Open template */
226  fh = fopen(template_file);
227  str = fscanf(fh," %c ");
228  fclose(fh);
229 
230  /* Replace occurences
231  *str = strrep(str,'%','%%') */
232  d = Devel.Instance;
233  str = strrep(str," $name ",name);
234  str = strrep(str," $date ",d.Date);
235  str = strrep(str," $authorshort ",d.AuthorShort);
236  str = strrep(str," $author ",d.Author);
237  str = strrep(str," $mainver ",KerMor.MainVersion);
238  str = strrep(str," $subver ",KerMor.SubVersion);
239 
240  /* Write to file */
241  fh = fopen(fname, " w+ ");
242  fprintf(fh, " %c ", str);
243  fclose(fh);
244 
245  /* Open for editing */
246  edit(fname);
247  }
248 
249 
264 };
265 
266 
267 
static function newClass(name, varargin)
Creates a new class using the template_class file.
Definition: Devel.m:171
static function setup()
Setup variables for Kermor Development when Kermor is setup for the first time or any other time manu...
Definition: Devel.m:153
static function newFun(name, varargin)
Creates a new function using the template_fun file.
Definition: Devel.m:190
char Author
The current developing author.
Definition: Devel.m:58
char AuthorShort
Author's short tag for identification in doxygen @new and @change tags.
Definition: Devel.m:71
Matlab's base handle class (documentation generation substitute)
Date
Always today's date.
Definition: Devel.m:83
A variable number of input arguments.
Developer utilities.
Definition: Devel.m:17
Global configuration class for all KerMor run-time settings.
Definition: KerMor.m:17
A MatLab character array.
static function Devel inst = Instance()
Returns the singleton instance of Devel.
Definition: Devel.m:141