1 -- Created on: 1992-05-13
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class GenId from Aspect
22 ---Purpose: This class permits the creation and control of all
24 -- Warning: An identifier is an integer.
30 ListOfInteger from TColStd
34 IdentDefinitionError from Aspect
39 returns GenId from Aspect;
41 ---Purpose: Creates an available set of identifiers with the lower
42 -- bound 0 and the upper bound INT_MAX/2.
44 Create ( Low, Up : Integer from Standard )
45 returns GenId from Aspect
47 ---Purpose: Creates an available set of identifiers with the lower
48 -- bound <Low> and the upper bound <Up>.
49 -- Warning: Raises IdentDefinitionError if <Up> is less than <Low>.
50 raises IdentDefinitionError from Aspect;
52 ---------------------------------------------------
53 -- Category: Methods to modify the class definition
54 ---------------------------------------------------
56 --Assign ( me : in out;
57 --Other : GenId from Aspect );
59 ---Purpose: Copies the content of <Other> into <me>.
60 ---Category: Methods to modify the class definition
61 -- C++: alias operator =
65 ---Purpose: Frees all identifiers of <me>.
66 ---Category: Methods to modify the class definition
69 Id : Integer from Standard );
71 ---Purpose: Frees the identifier <Id> of <me>.
72 ---Category: Methods to modify the class definition
74 ----------------------------
75 -- Category: Inquire methods
76 ----------------------------
79 returns Integer from Standard;
81 ---Purpose: Returns the number of available identifiers of <me>.
82 ---Category: Inquire methods
85 returns Integer from Standard;
87 ---Purpose: Returns the lower bound of <me>.
88 ---Category: Inquire methods
91 returns Integer from Standard
93 ---Purpose: Returns an available identifier of <me>.
94 -- Warning: Raises IdentDefinitionError if all identifiers are busy.
95 raises IdentDefinitionError from Aspect;
98 returns Integer from Standard;
100 ---Purpose: Returns the upper bound of <me>.
101 ---Category: Inquire methods
108 -- Class : Aspect_GenId
110 -- Purpose : Declaration of variables specific to identifiers
112 -- Reminder : An identifier is an integer
115 -- the current number of available identifiers
116 MyCount : Integer from Standard;
118 -- the number of identifiers
119 MyLength : Integer from Standard;
121 -- the limits for identifiers
122 MyLowerBound : Integer from Standard;
123 MyUpperBound : Integer from Standard;
125 -- to save free identifiers
126 MyFreeIds : ListOfInteger from TColStd;