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
IDGenerator.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 
18  :public handle {
41  public:
42 
66  private:
67 
68  IDGenerator() {
69  this.Seed= sum(clock)+cputime;
70  this.Counter= 1;
71  }
81  function id = genID() {
82  id = CalcMD5(this.Seed+this.Counter);
83  /* id = id(1:10); */
84  this.Counter= this.Counter+1;
85  }
86 
87 
88  public: /* ( Static ) */
89 
90  static function gen = generateID() {
91  persistent g;
92  if isempty(g)
93  g = IDGenerator;
94  end
95  gen = g.genID;
96  }
106 };
107 
108 
109 
Counter
Counts how many IDs have been generated since singleton instantiation.
Definition: IDGenerator.m:54
function MD5 = CalcMD5(Data, InClass, OutClass)
128 bit MD5 checksum: file, string, byte stream [MEX] This function calculates a 128 bit checksum for...
Definition: CalcMD5.m:17
static function gen = generateID()
Generates a new unique ID.
Definition: IDGenerator.m:90
Matlab's base handle class (documentation generation substitute)
Seed
The seed used as base for new IDs.
Definition: IDGenerator.m:43
Generates unique IDs.
Definition: IDGenerator.m:17