File : data/ObjId.js

1
/*
2
Copyright - 2017 2023 - wwwouaiebe - Contact: https://www.ouaie.be/
3
4
This  program is free software;
5
you can redistribute it and/or modify it under the terms of the
6
GNU General Public License as published by the Free Software Foundation;
7
either version 3 of the License, or any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
15
*/
16
/*
17
Changes:
18
    - v4.0.0:
19
        - created from v3.6.0
20
Doc reviewed 202208
21
 */
22
23
import { ZERO } from '../main/Constants.js';
24
25
/* ------------------------------------------------------------------------------------------------------------------------- */
26
/**
27
objId's generator
28
*/
29
/* ------------------------------------------------------------------------------------------------------------------------- */
30
31
class ObjId {
32
33
    /**
34
    The last sed objId
35
    @type {Number}
36
    */
37
38
    static #objId = ZERO;
39
40
    /**
41
    get a unique objId
42
    @type {Number}
43
    */
44
45
    static get nextObjId ( ) { return ( ++ ObjId.#objId ); }
46
47
}
48
49
export default ObjId;
50
51
/* --- End of file --------------------------------------------------------------------------------------------------------- */
52